Skip to content

Fix OpenStreetMap PoiCollection crash and migrate build to esbuild - #373

Merged
sfroemkenjw merged 8 commits into
mainfrom
fixOsmPoiCollectionAndMigrateToEsbuild
Aug 3, 2026
Merged

Fix OpenStreetMap PoiCollection crash and migrate build to esbuild#373
sfroemkenjw merged 8 commits into
mainfrom
fixOsmPoiCollectionAndMigrateToEsbuild

Conversation

@sfroemkenjw

Copy link
Copy Markdown
Contributor

Summary

  • Add the missing "Version 13.0.0" ChangeLog section for the TYPO3 14
    compatibility PR (Add TYPO3 14 compatibility #365), which bumped the extension version but
    never documented it.
  • Fix a TypeError in OpenStreetMap2.js: when a CityMap element has
    no assigned PoiCollection, data-pois is rendered as the literal
    string "null", which JSON.parse turned into null and crashed
    isPOICollectionsEmpty(). Fall back to [] with JSON.parse(...) ?? [].
  • Replace the unmaintained gulp/gulp-concat/gulp-uglify/
    gulp-sourcemaps toolchain with a single esbuild-based build.mjs
    script, cutting the npm dependency tree from 383 to 8 packages.
    Supersedes [TASK] Replace Gulp with Esbuild for Maps2 build chain #371 (adds the bugfix, changelog and version bump on top
    of the same underlying esbuild migration) and makes Bump brace-expansion and gulp in /Resources/Private/Build #372
    (Dependabot's gulp 4→5 bump) obsolete, since gulp is removed entirely.
  • Bump the extension version to 13.0.1 in composer.json,
    ext_emconf.php and Documentation/guides.xml.

Test plan

  • npm run build executed successfully inside the DDEV container
    (Node 24), output validated with node --check for all generated
    files.
  • Frontend verified in the browser for both map providers: Google
    Maps (/extension/maps2/point, /extension/maps2/city-map) and
    OpenStreetMap (same pages, after switching mapProvider to osm),
    no console errors after the fix.
  • Backend POI editor (interactive Google Maps picker) verified in
    the browser, no console errors.

The TYPO3 14 compatibility PR (#365) bumped the extension
version to 13.0.0 in composer.json but never added a
corresponding ChangeLog entry. Add the missing "Version
13.0.0" section, summarizing the most relevant architectural
and compatibility changes introduced by that PR: the new
Environment/EnvironmentFactory and MapProviderEnum/
MapperFactory abstractions, the switch to ConnectionPool and
CSP-compliant asset definitions, and the removal of TYPO3 13
compatibility and several deprecated helper classes.
Replace the unmaintained gulp/gulp-concat/gulp-uglify/
gulp-sourcemaps toolchain with a single esbuild-based
build.mjs script. This reduces the npm dependency tree from
383 to 8 packages and removes the last maintenance burden
Dependabot kept flagging for this extension, without changing
the resulting minified output.

Also fix a TypeError in OpenStreetMap2.js: when a CityMap
element has no assigned PoiCollection, the data-pois attribute
is rendered as the literal string "null", which JSON.parse
turned into a null value and crashed isPOICollectionsEmpty().
Fall back to an empty array with JSON.parse(...) ?? [] instead.
Bump the extension version to 13.0.1 in composer.json and
Documentation/guides.xml, and add the corresponding ChangeLog
section, covering the OpenStreetMap PoiCollection bugfix and
the esbuild build tooling migration.
The "tx_address" mentioned in the previous entry is only a
generic fixture extension added to the functional test suite
to prove Maps2Registry works independently of a specific
table; it is not a real integration target next to
tt_address. Describe the actual production change instead:
the registry moved from a JSON-file-based Singleton to
TcaSchemaFactory-driven, cached, event-listener-based
detection of maps2Relation columns.
The previous version bump updated composer.json and
Documentation/guides.xml but missed the version field in
ext_emconf.php, leaving it out of sync at 13.0.0.
CodeQL flagged two "DOM text reinterpreted as HTML" alerts in
OpenStreetMap2.js: showSwitchableCategories() interpolated a
category title into insertAdjacentHTML(), and getCheckbox()
interpolated a category uid into an innerHTML template
literal. Both category properties can originate from
sys_category records edited by lower-privilege backend users
and were rendered unescaped for every frontend visitor.

Build both elements with plain DOM APIs (createElement,
textContent, property assignment) instead, which removes the
HTML-injection sink entirely.
The same "DOM text reinterpreted as HTML" pattern CodeQL
flagged in OpenStreetMap2.js also exists in GoogleMaps2.js:
showSwitchableCategories() interpolated a category title into
insertAdjacentHTML(), and getCheckbox() interpolated a
category uid into an innerHTML template literal.

Build both elements with plain DOM APIs (createElement,
textContent, property assignment) instead, matching the fix
already applied to the OpenStreetMap implementation.
@sfroemkenjw
sfroemkenjw merged commit 06495e4 into main Aug 3, 2026
6 checks passed
@sfroemkenjw
sfroemkenjw deleted the fixOsmPoiCollectionAndMigrateToEsbuild branch August 3, 2026 13:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant