Kunstmaan / KunstmaanBundlesCMS

An advanced yet user-friendly content management system, based on the full stack Symfony framework combined with a whole host of community bundles. It provides a full featured, multi-language CMS system with an innovative page and form assembling process, versioning, workflow, translation and media managers and much more.
https://kunstmaancms.be
MIT License
399 stars 188 forks source link

No longer able to delete sub-sub-entities from page parts #3218

Closed iknowfoobar closed 7 months ago

iknowfoobar commented 1 year ago

We have recently had reports from many clients that they get server errors when trying to delete items from their pages, most of our sites have been upgraded to 6.1.* over the last year but I haven't been able to work out specifically when this started happening.

We commonly use this structure for page parts:

Page Part -> Sub Entity (1toMany) -> Images (1toMany)

An example could be a page part that has a title, then has n rows of which each have n images.

The error we are getting is something like

call_user_func(): Argument #1 ($callback) must be a valid callback, class App\Entity\PageParts\TwoColImageTextPagePart does not have a method "getTwoColImageTexts_0_images"

It looks like the problem is coming from https://github.com/Kunstmaan/KunstmaanBundlesCMS/blob/05307f9e8c60e9c074874353ee4e19136fe32f09/src/Kunstmaan/PagePartBundle/PagePartAdmin/PagePartAdmin.php#L166 which looks like it should only be handling 1 level of sub entities.

Is this a bug or just us doing something that Kuma doesn't support?

acrobat commented 1 year ago

Hi @iknowfoobar! We didn't have any similar problems so far, but can you maybe create a small reproducer with the demo app? (cms-skeleton install with demo content and add this type of pagepart or edit an existing)

That would make testing the actual problem easier for us!

iknowfoobar commented 1 year ago

Yup will do. I'll let you know when it is set up

iknowfoobar commented 1 year ago

Hi @acrobat

Finally got round to setting up a demo. https://github.com/iknowfoobar/kunstmaan-cms-sub-sub-entities

Check out App\Entity\PageParts\TwoColImageTextPagePart

It has one -> many sub entities of which each can have a further one -> many sub entity.

If you remove one of the sub-sub entities via the admin and save you get the error quoted above. Pretty sure this used to work for us, however has recently stopped. But not sure exactly when.

Thanks

jerome2710 commented 1 year ago

I can confirm our clients are having issues regarding this matter as well. Any updates on this @acrobat? It seems that the regex on r.149 only takes one level into account.

acrobat commented 1 year ago

I've lost track of this issue, let me check the reproducer app shared above and I will come back with some feedback!