VCL upload errors don't appear on the form

Created on 7 December 2021, over 2 years ago

When attempting to upload the Fastly VCL snippets through the admin form, if there is an error, those errors are never displayed to the user. Even if you refresh the page, the errors don't appear.

This came to light when I was getting permissions errors (the API key I was trying to use didn't have enough permission) but I couldn't see any errors - none appeared on the form nor in the logs. The HtmlCommand was trying to populate an oddly-named span with a FALSE value (as that is the response from the execute method if there's an error).

Doing some digging, I also discovered that some of the code in the VclHandler class may have been repurposed at some point, as the lastVersionData property is set weirdly - it was defined as an array, but the method that sets it sets an object but could return FALSE if there was no information, leading to a lot of potential for errors in that bit of the code.

Going forward I think this solution could be extrapolated into other parts of the admin form, but I was concentrating on this bit for the short term.

Patch soon to be attached.

πŸ› Bug report
Status

Needs review

Version

3.0

Component

Code

Created by

πŸ‡¬πŸ‡§United Kingdom Sophie.SK

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

No activities found.

Production build 0.69.0 2024