silverstripe / silverstripe-asset-admin

Silverstripe assets gallery for asset management
BSD 3-Clause "New" or "Revised" License
20 stars 79 forks source link

Allows display of validation messages on assets #1377

Closed blueo closed 1 year ago

blueo commented 1 year ago

Fixes #967 introduced in https://github.com/silverstripe/silverstripe-asset-admin/pull/1138

Adds an optional xhr parameter to the getStatusCodeMessage function to allow displaying custom validation messages from the CMS.

GuySartorelli commented 1 year ago

Thanks for submitting this. It's a good start, and handles the case for uploading new files - but it seem to resolve the main problem described in the issue you've linked to, which is that no error is displayed when you save a file which already exists.

Would you like to try tackling that part of the issue? Or would you prefer this fix to be merged as-is, as it is an objective improvement over the current state of affairs.

If you'd like to have this merged as is, please retarget the 1.13 branch so it can be released as a patch.

blueo commented 1 year ago

which is that no error is displayed when you save a file which already exists

thanks @GuySartorelli tbh I was only trying to address the new file scenario as that's the immediate use case we've got. I'm not opposed to looking into the existing file but ideally as a separate change if possible? I'll retarget the branch

GuySartorelli commented 1 year ago

I'm not opposed to looking into the existing file but ideally as a separate change if possible?

Yup no worries. I'll leave the issue open as it isn't resolved, and I'll merge this once ci goes green.

GuySartorelli commented 1 year ago

Thisnwill be auto-tagged once CI has finished running on the branch.