alphagov / whitehall

Publishes government content on GOV.UK
https://docs.publishing.service.gov.uk/apps/whitehall.html
MIT License
890 stars 191 forks source link

Fix content block form errors #9420

Closed tahb closed 1 week ago

tahb commented 1 week ago

The errors on the new/edit form for the content_block:edition object stopped working. They’d display on the page with anchor links but clicking those wouldn’t move the user to the related input.

The anchor links that the errors were using had changed from “content_block_edition” to “content_block/edition”. This is likely due to a recent refactor that renamed these objects to make them more concise across the code base[1].

Instead of trying to change the automatically generated error links we instead update the ids of the input fields to bring them inline. Hopefully we’ll be more in keeping with Rails conventions this way.

[1] https://github.com/alphagov/whitehall/pull/9304