Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to 4.x breaking content #867

Closed
chrisrowe opened this issue Mar 22, 2024 · 4 comments
Closed

Upgrade to 4.x breaking content #867

chrisrowe opened this issue Mar 22, 2024 · 4 comments

Comments

@chrisrowe
Copy link

Bug Description

After upgrading to 4.x some blocks are disappearing in the CP. I've diff'd the DB and the content is the same, migrations appear to have run so not sure whats happening. When trying to run resave/neo-blocks I get a bunch of errors

3833/4804] Resaving 7865 (7865) ... error: Skipped resaving 7865 (7865) due to an error obtaining its root element: Invalid owner ID: 7687

I suspect this is at play but unsure how to work around this, everything else is up to date and we don't have preparse or any other weird fields here.

Steps to reproduce

run craft update all

Expected behaviour

No response

Neo version

4.x

Craft CMS version

4.8.4

What is the affected Neo field's propagation method?

Save blocks to all sites the owner element is saved in

Does this issue involve templating, and if so, is eager-loading used?

This is not a templating issue

@ttempleton
Copy link
Contributor

I haven't had this happen when upgrading Neo installs to 4.x - if possible, could you please send your composer files and database backup to plugins@spicyweb.com.au and we'll have a look at it.

@ttempleton ttempleton added bug report status: unconfirmed A bug report that has not yet been reproduced by the maintainer(s), and more information is required and removed bug report status: new labels Mar 26, 2024
@chrisrowe
Copy link
Author

Cheers, followed up via email.

@ttempleton ttempleton added this to the 4.1.0 milestone Mar 29, 2024
@ttempleton
Copy link
Contributor

Thanks for sending those files. It turned out that at least one row in the neoblockstructures table had a siteId that was set to null, which is how we used to set site IDs on block structures on single-site Craft installs. I'm not really sure why that hadn't been re-set to the primary site ID, but I've added a console command for the next release (php craft neo/fields/fix-block-structure-site-ids) to make that change for any affected block structures. If you'd like to apply that fix before the next release, set your composer.json file's spicyweb/craft-neo requirement to 4.x-dev as 4.0.8 and run composer update.

Regarding the invalid owner ID errors - the owner IDs in the errors corresponded to rows in the elements table where the type was craft\models\EntryDraft, which was removed in Craft 4. Follow the solution given in craftcms/cms#11816 to fix those rows.

@chrisrowe
Copy link
Author

Thanks so much! I'll take it for a spin soon.

@ttempleton ttempleton added bug report status: fixed and removed bug report status: unconfirmed A bug report that has not yet been reproduced by the maintainer(s), and more information is required labels Mar 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants