Opened 3 years ago

Closed 3 years ago

Last modified 2 years ago

#33302 closed New feature (fixed)

Make the element_id argument of json_script optional

Reported by: Baptiste Mispelon Owned by: Baptiste Mispelon
Component: Template system Version: 3.2
Severity: Normal Keywords:
Cc: Baptiste Mispelon Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


I recently had a use-case where I wanted to use json_script but I didn't need any id for it (I was including the <script> inside a <template> so I didn't need an id to refer to it).

I can't see any reason (security or otherwise) for the id to be required and making it optional doesn't seem to break any tests.

Change History (5)

comment:1 by Baptiste Mispelon, 3 years ago

Cc: Baptiste Mispelon added
Has patch: set

comment:2 by Carlton Gibson, 3 years ago

Triage Stage: UnreviewedAccepted

Seems reasonable yes. Thanks.

comment:3 by Mariusz Felisiak, 3 years ago

Owner: changed from nobody to Baptiste Mispelon
Triage Stage: AcceptedReady for checkin

comment:4 by Mariusz Felisiak <felisiak.mariusz@…>, 3 years ago

Resolution: fixed
Status: assignedclosed

In e6e664a7:

Fixed #33302 -- Made element_id optional argument for json_script template filter.

Added versionchanged note in documentation

comment:5 by Adam Johnson, 2 years ago

Just wanna say thanks for the feature. I just had the same thought and wrote #33469 before finding it has already been done!

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