-
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
Unable to remove last UploadField item in inline editing mode #1265
Comments
Thanks for reporting this. |
Just tested against a site running 5.2 (for both elemental and admin/framework) and this bug does not exist in that version, so this one appears to be a regression |
Looks like the JSON in the POST that saves the block content used to be just nicely the correct types, and in 5.3 all of the values are strings and the file array is simply missing. I know the code for saving blocks was reworked significantly to get inline-validation working correctly so that's probably the reason it regressed. But I can't think of any reason for the string conversion to be happening. tl;dr if we can find out why the values are being converted to strings, that's probably also what's preventing the upload field files array from being included in the POST request. |
I would probably even bump this to |
Just looking at the labels docs and critical says "Website breaking issue with no workarounds" I don't know that this qualifies as "website breaking". Regardless of label semantics, I'll work on a fix for this (or at least try to chase down why those values are being transformed) |
You can always remove and re-add the block as a workaround, that’s what I
ended up doing 😅
…On Tue, 5 Nov 2024 at 21:22, Guy Sartorelli ***@***.***> wrote:
Just looking at the labels docs
<https://docs.silverstripe.org/en/5/contributing/issues_and_bugs/#labels>
and critical says "Website breaking issue with no workarounds"
I don't know that this qualifies as "website breaking".
Regardless of label semantics, I'll work on a fix for this.
—
Reply to this email directly, view it on GitHub
<#1265 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAMUF7BHMNMTWY6CGU7S3W3Z7EZK7AVCNFSM6AAAAABRD44FSGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDINJYGE3TKNJRGU>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Looks like formschema has always sent values as strings instead of their original types, and has never sent information about files when you explicitly remove files. Part of the change to elemental was making it rely on formschema submission directly instead of doing its own funky special form submission. So that explains why the form submission types have changed. I'm gonna explore two options:
|
1 can't be done, the request is sent using type |
Linked PRs have been merged, version of elemental with the patch will be automatically released shortly |
Thanks all! |
Module version(s) affected
5.3.0
Description
When inline-editing an item that contains an UploadField, it’s not possible to remove the last item from the UploadField. It appears to be removed, but after saving & refreshing the page it re-appears. Removing other items works as expected, but removing the final item triggers the issue. Affects both multi-upload fields and single item ones.
Screen.Recording.2024-11-04.at.10.08.34.mov
How to reproduce
Expand to see example elemental block with upload fields
Possible Solution
No response
Additional Context
No response
Validations
silverstripe/installer
(with any code examples you've provided)PRs
The text was updated successfully, but these errors were encountered: