Important: A study plan shown again gets dialog ids of its own
Description
An editor can show a study plan a second time on the same page, through an
"Insert records" element. Both copies rendered the same dialog ids,
popup-<module uid>
, and the script looked a dialog up in the whole
document. A module of the second copy therefore opened the dialog of the first
one, and when a theme hid the first copy, in a tab or an accordion, the visitor
got a modal dialog of zero size and a page that did not react until Escape.
Two things change:
- The script looks the dialog a trigger names up inside its own plan first, and in the whole document only when the plan has none.
- A plan rendered inside another content element gives its dialogs ids that
carry that element:
popup-, wherec<uid>-<module uid> <uid>is the uid of the content element it is rendered inside. The partials receive the prefix asid. A plan placed on the page renders the ids it rendered before.Prefix
Impact
A plan placed on the page renders unchanged.
A plan shown by an "Insert records" element renders prefixed dialog ids, and so
does a plan inside a grid element of a container extension that renders its
children through
RECORDS
,
CONTENT
,
f: or, on TYPO3 v14,
f::
<button data-study-plan-dialog-trigger data-dialog-id="popup-25">…</button>
<dialog id="popup-25" data-study-plan-dialog>…</dialog>
<button data-study-plan-dialog-trigger data-dialog-id="popup-c69-25">…</button>
<dialog id="popup-c69-25" data-study-plan-dialog>…</dialog>
Two arrangements still repeat a dialog id: one "Insert records" element that
lists the same plan twice, and an "Insert records" element that inserts another
"Insert records" element which is on the page as well. The dialogs open in the
right copy there too. The frame id
c<uid>
the core renders around every
content element repeats for every copy, it is not part of the study plan.
Migration
An installation that overrides Academic,
Study, Study or
Study passes
id on and starts the
dialog id with it, as the shipped partials do:
<f:render partial="StudyPlan/ModuleDialog" arguments="{module: module, idPrefix: idPrefix}" />
<dialog id="popup-{idPrefix}{module.uid}" data-study-plan-dialog>
An override that does not pass it on keeps the previous ids and keeps working: its dialogs open in the right copy, they only repeat their ids when the plan is shown twice. A stylesheet or script that addresses a dialog of an inserted plan by its id adds the prefix.
Affected Installations
Installations that show a study plan through an "Insert records" element or a grid element, and installations that override the template or the semester, module or dialog partial.