django-fluent-contents
django-fluent-contents copied to clipboard
Placeholders incorrectly set by JS on validation errors for new pages
Steps to reproduce:
- Create a new page, selecting a type and clicking Save (do not click save yet on the next step of the creation process)
- Select a layout and add content to placeholders
- Leave a required field such as title blank, and save
- Django will come back with a validation error for the required field
However, at this stage, the placeholders will have been incorrectly initialised, and saving again will result in a generic validation error with no fields highlighted to indicate what the problem is. There will also be a number of superfluous placeholder tabs labelled "new..." visible.
Selecting a different layout and then the desired one again seems to resolve the problem, by getting the JS to re-initialise the placeholders.
Requiring the JS to re-initialise the placeholders when the page is loaded with the validation error is likely to fix the problem.