Important: Partner map draws on a late module load
Description
The partner map did not draw on most page loads. The container stayed empty, no tiles, no markers, and nothing was reported anywhere - not in the browser console, not in the TYPO3 log.
Resources/ bound its whole body to
document. without asking whether
that event was still ahead of it.
f: renders every module with
async
: the ViewHelper
accepts an identifier and nothing else, and
\TYPO3\ writes the attribute
unconditionally. An async module is not ordered against document parsing, so it
regularly runs after
DOMContent has already fired. The listener was
then registered on an event that never comes again.
The module now runs its initialisation immediately when the document has finished parsing, and waits only while it has not:
if (document.readyState === 'loading') {
document.addEventListener('DOMContentLoaded', initializeMap, { once: true });
} else {
initializeMap();
}
That is the shape the other frontend modules of this repository already use. This was the only one missing it.
Impact
The map draws on every load. Nothing about its markup, its configuration or its data changed, and an installation that saw the map draw before - the load where the module happened to win the race - sees no difference.
Affected Installations
Every installation rendering the Partners Map plugin, or a template that includes the map module.