spicywebau / craft-neo

A Matrix-like field type for Craft CMS that uses existing fields
Other
403 stars 63 forks source link

Infinite loop in the cms. Auto saving the draft before the entry is manually saved causes the loop #888

Closed pnpaes closed 1 month ago

pnpaes commented 1 month ago

Bug Description

When entering the CMS and creating a new entry in a channel or structure, before the entry is saved, the autosave is going into a loop, but only when one or more Neo blocks are added. Once i edit any content in the Neo block, the admin/actions/elements/save-draft is called with success message "Draft Saved" and docTitle "Create a new entry (First draft)". Then the admin/actions/neo/input/update-visible-elements is called and it returns an object with a new0 property and in it there is a "missingElements" property. then it triggers again the save-draft and the update-visible-elements again and again and again. Until, at some point, it throws an error "Invalid draft ID: XXXX". But if I leave the new section without saving and go to the listing, the draft is actually created. This is a multi site installation.

Steps to reproduce

More details:

Application Info PHP version 8.3.3 OS version Linux 6.4.16-linuxkit Database driver & version MariaDB 10.7.8 Image driver & version Imagick 3.7.0 (ImageMagick 6.9.11-60) Craft edition & version Craft Pro 4.9.4 Yii version 2.0.48.1 Twig version v3.8.0 Guzzle version 7.8.1

Plugins CKEditor 3.8.3 Colour Swatches 4.4.0 Control Panel Nav 4.0.12 Cookies 4.0.1 DigitalOcean Spaces Filesystem 2.0.0 Feed Me 5.4.0 Field Manager 3.0.8 Image Resizer 3.0.11 Neo 4.1.2 Redactor 3.0.4 SEOMate 2.2.1 Super Table 3.0.14

Expected behaviour

No response

Neo version

4.1.2

Craft CMS version

4.9.4

What is the affected Neo field's propagation method?

Save element 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 commented 1 month ago

Please provide detailed steps to reproduce, including the creation of a minimal Neo field and block type field layouts that reliably reproduce this behaviour for you.

pnpaes commented 1 month ago

@ttempleton i got craft team to look at it. if they do not manage to find the reason I can send composer and db so you can test it out.

ttempleton commented 1 month ago

It might also be worth upgrading to Neo 4.2.0, in case some changes involving the updating of visible elements have resolved this issue.

ttempleton commented 1 month ago

Closing as resolved in 4.2.0, per @i-just's comments in https://github.com/craftcms/cms/issues/15046.

pnpaes commented 1 month ago

Thank you. I got her feedback and i will give it a try today 👍🏼Kind regards,Paulo PaesOn 31 May 2024, at 08:27, Thomas Templeton @.***> wrote: Closing as resolved in 4.2.0, per @i-just's comments in craftcms/cms#15046.

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***>