Giter Site home page Giter Site logo

Comments (5)

i-just avatar i-just commented on July 21, 2024

Hi, thanks for reaching out! Could you please post the full stack trace for this error?

from cms.

samdi avatar samdi commented on July 21, 2024

In admin page, I access a structure entry with this error: https://cldup.com/n20M4rtNN9.png
View the entry with this error: https://cldup.com/7gO0jMSBU7.png

from cms.

i-just avatar i-just commented on July 21, 2024

Thanks! I can’t seem to replicate this issue. Any chance you could send your composer.json, composer.lock and database export to [email protected] and point out the entry that is giving you this error?

from cms.

samdi avatar samdi commented on July 21, 2024

Thanks for your info. I think if there is something wrong due to the changing the field type (table to plain text). The entry is saved the table data of the previous field type while the field type is plain text. In database table element_sites > content of all entries, the data of table field is still existing, for example.

{"col1":"Original title","col2":"Abc title"},{"col1":"Alternative title","col2":"XYZ title"}

Anyway, I deleted those entries. Do you think if the issue is due to changing the type of field and the old data exists in the element_sites > content?

from cms.

i-just avatar i-just commented on July 21, 2024

Thanks for providing more info!

due to the changing the field type (table to plain text)

With that missing piece of information, I can replicate it straight away.

When you change the type of the field, Craft doesn’t alter your data in the database. In Craft 4, changing a Field Type could lead to a database column that stored this data to be altered, therefore leading to data loss. In Craft 5, content is stored in a json column, but data incompatibility can still occur. There’s a warning under the Field Type dropdown about potential data loss and the types that should be safe to switch to don’t have the warning icon next to them.

You can still change the Field Type to one with a warning, but issues like this can occur. You can use the resave command to fix this. You can use it to clear out the field value or change it to something else. For example, php craft resave/entries --section blog --type article --set table --to "=" --if-empty 0 will clear out the value of a field with a handle table for a section blog and entry type article.

I hope this helps!
I will close this now, but feel free to reach out if you run into any more problems.

from cms.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.