-
Notifications
You must be signed in to change notification settings - Fork 116
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
UploadField
inside inline-editable element doesn't update when saving parent record in a GridFieldDetailForm
#1156
Comments
It's a bit hard to tell from the description and the video is too zoomed in to tell - is this specifically related to nested inline-editable elemental blocks? i.e, editing an inline-editable block inside a block which is, also, inline-editable? |
Yes
|
Marking as an enhancement - I don't think that's a use case that has been considered as supported so far. |
There are quite a few existing issues (open and closed) referencing nested blocks (e.g. #775 / #824) and there's https://github.com/dnadesign/silverstripe-elemental-list too so I think it's probably used more than you think |
#775 doesn't specify nested inline-editable blocks, and #824 ends with this:
Nested blocks is one thing. Nested inline editable blocks inside other inline editable blocks is quite another. |
Yes my page that contains the first element area isn’t inline editable, just the ArticleBlock that contains the nested Element Area is. So they’re not nested inline editable, but the nested elemental is if that makes sense? The rest of the blocks that don’t contain data relations (grid fields and upload fields) work fine inline editable. In #824 @tractorcow did state “ Ah right, you can't inline edit inside another inline parent, but you can inline edit inside a non-inline parent. :)” which is what I’m doing here |
Ahhh okay that changes things. I've checked this - and also tried with a non-page model which has an |
UploadField
inside inline-editable element doesn't update when saving parent record if the parent record is in a GridFieldDetailForm
UploadField
inside inline-editable element doesn't update when saving parent record if the parent record is in a GridFieldDetailForm
UploadField
inside inline-editable element doesn't update when saving parent record in a GridFieldDetailForm
Just checked with previous versions - this worked in 4.13 but doesn't work in 5.0, so something broke in the major release. |
Linked PRs have been merged. They will be released as part of CMS 5.3 |
Module version(s) affected
5.1
Note: this worked in 4.13 but doesn't work in 5.0, so something broke in the major release.
Description
click to see original description
I have a Elemental block, with a ElementalArea, so, so an ElementalArea inside another ElementalArea. If inline-editing a block on the 2nd level ElementalArea has an UploadField, on page save, the UploadField value doesn't update (nor any of the other fields). However, if you refresh the CMS the block editor re-renders with the updated information, so it's saving to the DB correctly.This bug happens if you have a model being edited inside a
GridFieldDetailForm
(e.g. any model edited in aModelAdmin
), and it can have elemental blocks, and an inline-editable elemental block with an upload field inside that model's elemental area.Any time you save the record using the "Save" button the gridfield detail form provides, it clears the upload field inside the elemental block, which makes it very difficult to save files in an upload field in this scenario.
Screen.Recording.2024-03-18.at.16.08.42.mov
How to reproduce
click to see original steps
Page with ElementalArea
Block with ElementalArea
Block with UploadField
Have a model which can be edited inside a modeladmin. The model must have an elemental area:
Add an elemental block with an upload field to the above record.
Add an image to the upload field and save using the "save" button on the parent record (not the inline-editable save button)
Possible Solution
No response
Additional Context
Workarounds include using some other field type or always saving blocks using the inline-save button (and hoping nobody every needs to edit the parent record)
Validations
silverstripe/installer
(with any code examples you've provided)PRs
Kitchen sink behat CI run with modules that might be affected by this change
NOTE There is one failure in that CI run - but it happens in kitchen sink even without the PR. It's not related to these changes.
The text was updated successfully, but these errors were encountered: