Impossible to edit or delete pages in Contentbox 6.1.0

Hi,

Currently testing the new contentbox 6.1.0 update on my dev environment.
Updating Contentbox went without a glitch (thanks!).

Now, Creating new pages works as expected, but when I want to edit or delete a page, I have the following error message :

org.hibernate.exception.ConstraintViolationException: could not execute statement

The cause of this error is the FK_contentID field in the cb_contentVersion table of the database. This field cannot be null. Making it nullable solves the issue, but introduces a new one.

After making that field nullable, I can edit and delete pages as expected, but then, the various content versions are not showing in the “History” tab of the page editor in the Contentbox Admin.

A quick look at the database shows that the previous version of the page (the one that is made inactive when saving) has a NULL value in the FK_ContentID column of the database, which triggers the Constraint Violation Exception mentioned above.

See image at https://app.screencast.com/Krk9xUYxjtMzh

Same error when editing/ removing ContentStore Items.
I have not (yet) been able to identify which line of code removes the fk_contentID value on the content version that is made inactive when saving a new version.

@jclausen what is this?

That is absolutely correct. That column should never be null - and you would want to set that back to not null on the table. The bigger question is how it is being nullified in the first place.

Exactly. And that is the question I have not been able to answer despite my research this afternoon.
It was working fine in the previous version of Contentbox, so it is caused by some code added to 6.1.0.

Could it be related to all the lazy loading stuff that have been added in various models (including the contentVersion.cfc model)?

Not likely, as those are just ORM directives. We’ve been running be for months on some of our production sites ( due to some of the bug fixes in this release ) and haven’t seen these issues, so I suspect this is something introduced within the last few days.

What DBMS are you using?

MariaDB on Ubuntu 24.04.
I have also seen the same issue on my MacOS (latest version) dev machine when using a MariaDB docker container

I’m able to replicate. Am looking in to it now.

v6.1.1 is building now and should resolve this issue.

Works like a charm!
Thanks for your fast reply and bug fix release.
You guys rock!

1 Like