You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description:
When editing a page in a grid field, the problem occurs that the updateFluentActions() method is called twice. This happens both from the FluentSiteTreeExtension and from the FluentGridFieldExtension.
This double call results in the clearFluent field and other fields from the corresponding trait being present more than once. This causes a RuntimeException to occur when saving.
Steps for reproduction:
Edit a page in a grid field in a Model Admin
Saving/Publishing the page.
Expected behavior:
updateFluentActions() should only be called once to avoid duplicate field definitions and the resulting exception.
Actual behavior:
updateFluentActions() is called twice, resulting in duplicate definition of fields and a RuntimeException.
Error Message:
[Emergency] Uncaught RuntimeException: SilverStripe\Forms\{closure}() I noticed that a field called 'action_clearFluent' appears twice in your 'SilverStripe\Forms\Form' form called 'ItemEditForm'
POST /admin/offers/OfferPage/EditForm/field/OfferPage/item/55/ItemEditForm
Line 165 in /var/www/ss_project_web/vendor/silverstripe/framework/src/Forms/FieldList.php
When editing a page in a grid field, the problem occurs that the updateFluentActions() method is called twice. This happens both from the FluentSiteTreeExtension and from the FluentGridFieldExtension.
I think I've had this issue before. I ended up solving it by just using a basic model, not a sitetree, which isn't really a reasonable workaround.
Suggested fix is to make the updateFluentAction() idempotent so that it safely can be called multiple times on the same action set.
I have now temporarily written a patch to call the function in the gridfield extension only if the form action is not one of the corresponding model admin.
Not a nice solution either, but it works for now.
Module version(s) affected
^7
Description
Description:
When editing a page in a grid field, the problem occurs that the updateFluentActions() method is called twice. This happens both from the FluentSiteTreeExtension and from the FluentGridFieldExtension.
This double call results in the clearFluent field and other fields from the corresponding trait being present more than once. This causes a RuntimeException to occur when saving.
Steps for reproduction:
Expected behavior:
updateFluentActions() should only be called once to avoid duplicate field definitions and the resulting exception.
Actual behavior:
updateFluentActions() is called twice, resulting in duplicate definition of fields and a RuntimeException.
Error Message:
How to reproduce
Model Admin:
FluentAdminTrait - updateFluentActions():
Possible Solution
No response
Additional Context
No response
Validations
silverstripe/installer
(with any code examples you've provided)The text was updated successfully, but these errors were encountered: