• Hey @xnau, I am using your plugin as a small CMS locally, since a while.

    I just realized, that when I create a new record and add a URL into the filed, when registering the project, the “href” is not created. When I check in the backend I see that the field in question is actually a “text-line”. It used to be a “link-field”…

    Here’s the old html code on the frontend from a record I created ages ago:

    <td class="domain-field">
        <a  target="_blank">domain-name.ch/</a>
    </td>

    And when I create a new one, it looks this in the html source code:

    <td class="domain-field">www.domain-name.ch</td>

    The class is still “domain-field”, but it get’s rendered without the actual URL.

    In the past I had to enter the text and the URL. So those must be in the database. And when I try to convert the “text-line” field to a “domain”link-field”, I get a warning that this could cause data loss.

    Now the question is, can I change the field type, and it will re-link to the existing records in the database?

    Obviously the data is still in the database. Or the old records would not render as a URL. So the data is still in the database. The old field interprets it correctly, but the new records use the “text-line” field type…

    Thanks!
    – Alex

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author xnau webdesign

    (@xnau)

    Hard to tell what the story is there, but you may want to take a look at the database values directly (using phpMyAdmin or a similar tool) to see what is actually stored in the field for your records. This is important because a “link” field stores its data as a 2-element array so it can hold the URL and the link text.

    Switching the field type from “text-line” to “link” won’t cause data loss because even though the two fields store their data differently, they are both strings (the array is serialized)…so changing the type will leave the strings intact. Also, the “link” type field can cope with a data value that is not an array, just the URL alone.

    Thread Starter alFrame

    (@alframe)

    Thanks @xnau for your response. I will need some time to investigate this in detail because I am swamped and backing up that local site is broken. And I need a backup to start the heart surgery.

    But I wanted to show a sign of appreciation for your answer. It gives me confidence that this is not lost. I will post if I resolve, or break.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘domain-field with no href’ is closed to new replies.