Git Product home page Git Product logo

Comments (2)

sheadawson avatar sheadawson commented on July 30, 2024

I think the only explanation for this is that at some point you must have been using a slightly old version of the blocks module that still had the "Name" DB field. Otherwise SilverStripe would not be trying to write to that table column. Perhaps your blocks module was also updated when updating framework/cms composer dependencies? Or a dev/build was required? I can't see any reason why this error would occur on 3.1 so will close for now.

from silverstripe-blocks.

Taitava avatar Taitava commented on July 30, 2024

Just for record to this old issue: Now when I returned to the project where I use this module, I spent a few hours scratching my head with this (as I don't like to solve it by upgrading SilverStripe before I find out the real cause behind a bug in order to prevent it in the future).

All code was correct and my version of the blocks module was not outdated. Instead, the problem was in the database structure. I checked the structure and saw the old Name column in the Block table. I removed the column from the table, tried saving again a new Block in the CMS, and ran into the same error message again, but this time with a different column name. So I proceeded to remove columns one by one until the saving started to work.

These are the columns I removed: Name, Header, Content, Link, VideoURL, Template and Active

So my conclusion is that your module works flawlessly, but there is a bug in the Versioned class (and I guess they fixed it in SS 3.2). Any column that existed in the Block table were used in the INSERT INTO Block_versions query without first ensuring that the column actually exist in Block_versions too. As those columns did not exist, the saving process failed.

So anybody still using SS 3.1 can run into this problem by first installing an old version of this module and then upgrading the module to the current version. The upgraded module itself does nothing bad, it just abandons columns and implements a support for Versioned, which naturally will not create the obsolete columns into the Block_versions table. Problem solved :).

Thank you @sheadawson for pointing me to the right direction! :)

from silverstripe-blocks.

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.