Skip to content

[FEAT] TYPO3 14 compatibility (JR-179) - #1

Open
fennec-agent wants to merge 9 commits into
feature/typo3-13from
feature/typo3-14-compat
Open

[FEAT] TYPO3 14 compatibility (JR-179)#1
fennec-agent wants to merge 9 commits into
feature/typo3-13from
feature/typo3-14-compat

Conversation

@fennec-agent

Copy link
Copy Markdown

What this extension is

cbgooglemaps (formerly Quick Google Maps) is a TYPO3 CMS extension that embeds maps from Google Maps, MapBox or OpenStreetMap/Leaflet into the frontend as a content element, via TypoScript or as a Fluid cObject. It ships an Extbase plugin (MapController), a FlexForm for per-element configuration, custom FormEngine elements (geocoding/preview buttons, JS-library loader) and the JS libraries.

Why

Driving ticket JR-179 (janda-roscher v13→v14 upgrade). cbgooglemaps was capped at TYPO3 ~12.4/13.4 and is a hard blocker for the project upgrade. This PR makes it install and run under TYPO3 14.3.x (PHP ≥ 8.2) while keeping 13.4 support (^13.4 || ^14.0) so the project can transition without a flag day.

Base branch: feature/typo3-13 — it is strictly ahead of develop (contains all of develop plus the 12.4/13.4 work: Services.yaml, MapController/TCA updates), so it holds the latest code.

v14 changes made

  1. Version constraints (composer.json): typo3/cms-*^13.4 || ^14.0, explicit php: ^8.2, added the extbase/frontend/backend/fluid subpackages the code actually uses.
  2. Removed TSFE (MapController): TypoScriptFrontendController / $GLOBALS['TSFE'] was removed in v14. addJsCss() now uses PageRenderer::addHeaderData() instead of $GLOBALS['TSFE']->additionalHeaderData (works in 13.4 + 14).
  3. Plugin sub types removed → CType migration (tt_content.php, ext_localconf.php): the legacy list_type plugin sub type was removed in v14. The plugin is now a dedicated CType cbgooglemaps_quickgooglemap:
    • registerPlugin() registers the CType (and auto-adds the wizard item).
    • FlexForm attached via addToAllTCAtypes('tt_content', 'pi_flexform', $cType, ...) + a static columnsOverrides[...]['pi_flexform']['config']['ds'] — replacing the deprecated addPiFlexFormValue() and the removed subtypes_addlist/subtypes_excludelist.
    • configurePlugin() now passes ExtensionUtility::PLUGIN_TYPE_CONTENT_ELEMENT.
  4. New Content Element Wizard: removed the manual mod.wizards.newContentElement page TSconfig (and its CType=list / list_type= defValues). Since v13 the wizard entry is auto-registered from the CType, so the manual entry caused a duplicate. Wizard title/description are passed to registerPlugin() instead.

Rector

Ran ssch/typo3-rector v3.14.2, set Typo3LevelSetList::UP_TO_TYPO3_13, dry-run against Classes/, Configuration/, ext_localconf.php (isolated docker php:8.3). It flagged exactly one change — MigratePluginContentElementAndPluginSubtypesRector adding PLUGIN_TYPE_CONTENT_ELEMENT to configurePlugin() — which was applied. Re-run is clean (Rector is done!).

Verified

  • composer validate --no-check-publish./composer.json is valid
  • php -l on all PHP files (Classes + Configuration + ext_localconf) → no syntax errors
  • TYPO3 Rector (UP_TO_TYPO3_13) dry-run → clean after the one applied fix
  • No test suite, no PHPStan config and no CI workflow exist in the repo → nothing to run / not invented (light touch).

Verified vs. not-yet-smoke-tested

Verified: version constraints, PHP lint, composer validate, Rector clean. Not yet smoke-tested in a real TYPO3 14 instance — needs an actual v14 install to confirm the content element renders in the backend (wizard, FlexForm, FormEngine buttons) and the map renders in the frontend for all three providers. No live v14 instance was available here.

Note: the extension is composer-only (no ext_emconf.php); left as-is to stay in scope.

🤖 Generated with Claude Code

Make the extension installable and runnable under TYPO3 14.3.x while keeping
TYPO3 13.4 support, so the janda-roscher project can transition smoothly.

Changes:
- composer.json: require typo3/cms-* "^13.4 || ^14.0", add explicit php "^8.2"
  and the extbase/frontend/backend/fluid subpackages the extension uses.
- MapController: replace the removed TSFE->additionalHeaderData (the
  TypoScriptFrontendController was removed in v14) with
  PageRenderer::addHeaderData(), which works in both v13.4 and v14.
- tt_content.php: migrate the plugin from the removed "list_type" sub type to a
  dedicated CType. registerPlugin() now registers CType
  "cbgooglemaps_quickgooglemap"; the FlexForm is attached via addToAllTCAtypes()
  plus a static columnsOverrides DS, replacing the deprecated
  addPiFlexFormValue() and the removed subtypes_addlist/subtypes_excludelist.
- ext_localconf.php: pass ExtensionUtility::PLUGIN_TYPE_CONTENT_ELEMENT to
  configurePlugin() (TYPO3 Rector MigratePluginContentElementAndPluginSubtypes).
- Remove the manual New Content Element Wizard page TSconfig (and its CType=list/
  list_type defValues): since v13 the wizard item is auto-registered from the
  CType, so the manual entry produced a duplicate. Wizard title/description are
  now passed to registerPlugin().

Verified: composer validate, php -l on all PHP files, TYPO3 Rector
(UP_TO_TYPO3_13) dry-run clean. Not yet smoke-tested in a live v14 instance.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jun 18, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 55978d37-8a52-4830-93dd-a02a8b910d6e

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/typo3-14-compat

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

thiilo and others added 8 commits June 23, 2026 13:26
The TYPO3 Extension Scanner flagged several deprecated/removed API usages
in MapController that the v14 compatibility commit had not yet covered:

- #109551 GeneralUtility::getIndpEnv('TYPO3_REQUEST_HOST') (deprecated in
  v14.3): replaced by $normalizedParams->getRequestHost(), cached on the new
  $requestHost property and used for the icon URLs.
- #109575 ContentObjectRenderer->parentRecord (deprecated in v14.3): removed.
  It was only used in a dead, always-false isset() expression appended to
  contentId.
- ContentObjectRenderer accessed via a fresh GeneralUtility::makeInstance():
  this returned an empty renderer, so $ceData was always null. Now the current
  content object is read from the "currentContentObject" request attribute (the
  supported way since v13), which also fixes the long-standing dead $ceData
  logic.

As a result contentId now uses the real content element uid (unique per CE)
instead of a random number, fixing potential DOM id / JS variable collisions
when multiple maps are rendered on one page. Flexform values are unaffected
(they continue to flow through $this->settings).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Bring the fork in line with the proven, complete TYPO3 v14 configuration that
already runs on the janda-roscher staging instance, so the fork can serve as the
single source of truth (consumed via Composer VCS) instead of a vendored copy.

Imported from the staging-validated config:
- CType registration via ExtensionUtility::registerPlugin + FlexForm data
  structure via static TCA (replaces the removed addPiFlexFormValue()).
- Declarative icon registration through Configuration/Icons.php (ce-default-icon
  -> ce_wiz.svg) instead of an imperative IconRegistry call in ext_localconf.
- list_type -> CType upgrade wizard (Classes/Updates) so existing content
  element records are migrated, plus the Extension.svg / marker.png assets.

MapController:
- Keep the v14 modernization: read the content object from the
  "currentContentObject" request attribute (a fresh ContentObjectRenderer carries
  no record data) and replace the deprecated
  GeneralUtility::getIndpEnv('TYPO3_REQUEST_HOST') with normalizedParams
  ->getRequestHost().
- Remove the page-header Google Maps script injection: the API must only load
  after the visitor granted consent. Loading happens in Map/Index.html after
  sg-cookie-optin emits "externalContentAccepted"; injecting it into the header
  loaded Google before consent (DSGVO violation).

The generic Map/Index.html stays in the extension; the janda-roscher-branded
template override moves to the sitepackage in a separate janda-roscher change.
…JR-179)

The MapController no longer injects the Google Maps API <script> into the page
header (to avoid loading Google before cookie consent), so the frontend template
must request the API itself. The generic Map/Index.html only referenced
google.maps.* without ever loading it, leaving google.maps undefined.

- Wrap the Google map container in a sg-cookie-optin protection element
  (#cbMapsOptIn / frame-external-content-protection).
- Request https://maps.googleapis.com/maps/api/js with the key from
  settings.googleapi.key, and run the map init only after the API onload — both
  triggered by the "externalContentAccepted" event (fired on accept and on load
  when consent was already granted).

Mirrors the consent-gated loader the janda-roscher sitepackage template uses, so
the extension renders a working, DSGVO-compliant Google map standalone too.
[TASK] complete v14 migration and keep consent-safe map loading (JR-179)
…R-179)

TYPO3 v14 ActionController declares $settings as a typed 'array' property.
Redeclaring it untyped in MapController triggered a fatal at container build
('Type of ...::$settings must be array'), which broke 'typo3 extension:setup'
during deploy. Restore the explicit array type (matches the parent and the
previously deployed code).
[FIX] restore array type on MapController::$settings for TYPO3 v14 (JR-179)
…-179)

Make the TYPO3 v14 plugin registration explicit by passing
ExtensionUtility::PLUGIN_TYPE_CONTENT_ELEMENT as the fifth configurePlugin()
argument. Behaviour is unchanged (omitting it already defaults to 'CType'
internally), but it silences the extension scanner finding for #105076/#105538
and documents intent now that list_type plugin sub types are gone.
[TASK] add explicit v14 CType plugin type to canonical branch (JR-179)
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.

2 participants