Opened 7 weeks ago

Closed 7 weeks ago

#36537 closed Bug (fixed)

Generate unique IDs for the OSM layer mapwidget options `json_script` tags

Reported by: Matthias Kestenholz Owned by: Matthias Kestenholz
Component: GIS Version: dev
Severity: Release blocker Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

The application/json script tag uses id="mapwidget-options" even when used multiple times on the same page. This is invalid HTML, let's change this to use unique IDs.

Refs https://github.com/django/django/pull/19566 and https://code.djangoproject.com/ticket/25706

Change History (5)

comment:1 by Matthias Kestenholz, 7 weeks ago

Has patch: set

comment:2 by Natalia Bidart, 7 weeks ago

Triage Stage: UnreviewedAccepted
Type: Cleanup/optimizationBug
Version: 5.2dev

Thank you Matthias! This follows an extensive conversation in the referenced PR.

comment:3 by Natalia Bidart, 7 weeks ago

Severity: NormalRelease blocker

This is a release blocker for 6.0.

comment:4 by Natalia Bidart, 7 weeks ago

Triage Stage: AcceptedReady for checkin

comment:5 by nessita <124304+nessita@…>, 7 weeks ago

Resolution: fixed
Status: assignedclosed

In 0a262c84:

Fixed #36537 -- Ensured unique HTML IDs for geometry widget option scripts in the admin.

This work amends the code from f2f6046c0f92ff1faed057da0711ac478eef439c
where multiple geometry widgets rendered <script> elements in the
admin with the same HTML id, resulting in invalid HTML and fragile
JavaScript selectors. Refs #25706.

This change uses the widget's textarea ID to generate a unique id for
each JSON options <script>, ensuring valid and robust markup.

Co-authored-by: Natalia <124304+nessita@…>

Note: See TracTickets for help on using tickets.
Back to Top