Upgrading from 2.3 to 2.4 

Version 2.4 moves the environment and state manager of this extension into an extension of its own, restructures the page TSconfig of the content element group Academic and keeps the stored type of an academic content element selectable on a page that does not offer it. Work through the sections in order. Skip a step that does not apply to the installation.

Before you start 

Version 2.4 runs on TYPO3 12.4 from 12.4.22 on and on TYPO3 13.4, with PHP 8.1 or later. That is the same as for 2.3, so the TYPO3 core does not have to change for this upgrade.

academic_base 2.4 needs one new package:

Every other academic extension depends on this one. Upgrade it in the same deployment as all academic extensions of the installation, and on a classic installation before them.

Update the package 

composer require -W \
    'fgtclb/academic-base':'~2.4.0'
Copied!

Composer installs fgtclb/environment-state-manager with it, and version 1.2 or later of the Composer plugin typo3/class-alias-loader , which keeps one deprecated class name resolving, see The environment and state manager. The TYPO3 core requires that plugin itself, so it is already allowed in every Composer based TYPO3 installation. A project that requires branch 2 as 2.x-dev keeps an inline alias such as 2.x-dev as 2.4.x-dev working, see Important: The development branch installs as 2.4.x-dev.

On a classic installation, install environment_state_manager 1.x from the TER in Admin Tools > Extensions first, because academic_base 2.4 cannot be activated without it. Then update academic_base there, and after it every other academic extension of the installation. Run the commands of this page with typo3/sysext/core/bin/typo3 instead of vendor/bin/typo3 .

vendor/bin/typo3 cache:flush
Copied!

Adapt the configuration 

Page TSconfig imports 

The page TSconfig that labels the content element group Academic moved, and the directory Configuration/TsConfig/ is spelled Configuration/TSconfig/ now. An @import of an old path loads nothing and reports no error, so search the site package for the old paths and replace them:

Old path New path
EXT:academic_base/Configuration/TsConfig/Wizards/NewContentElement.tsconfig EXT:academic_base/Configuration/TSconfig/CTypeGroup/page.tsconfig
EXT:academic_base/Configuration/TsConfig/Wizards/*.tsconfig EXT:academic_base/Configuration/TSconfig/Full/page.tsconfig
EXT:academic_base/Configuration/Sets/AcademicBaseCTypeGroup/page.tsconfig EXT:academic_base/Configuration/TSconfig/CTypeGroup/page.tsconfig

An import that only served to label the group can be removed instead. The Configuration/page.tsconfig of this extension delivers the label to every installation, on TYPO3 12 and TYPO3 13, whatever the site configuration says.

Site configurations need no change. The set fgtclb/academic-base-ctype-group keeps its name, and the new aggregate set fgtclb/academic-base depends on it. Two entries for the page field Include static Page TSconfig (from extensions) on the tab Resources are new as well and need not be selected. See Breaking: Site sets and page TSconfig have been restructured.

Label overrides of select items 

The items of a TCA select field that a frontend form of an academic extension offers, the job type of the job form of academic_jobs for example, read their label overrides from the path without underscores now. Move an override from the extension key to the extension name, or to the path of the one plugin it is meant for:

# Before
plugin.tx_academic_jobs._LOCAL_LANG.default.tx_academicjobs_domain_model_job.jobtype.job = Position

# After
plugin.tx_academicjobs._LOCAL_LANG.default.tx_academicjobs_domain_model_job.jobtype.job = Position
Copied!

See Important: Select item labels are read from the documented path.

Adapt your code 

The environment and state manager 

The classes of the namespaces \FGTCLB\AcademicBase\Environment , \FGTCLB\AcademicBase\Core12\Environment and \FGTCLB\AcademicBase\Core13\Environment are deprecated and are removed in version 3.0. They were marked @internal and raise no deprecation notice. Code of a project that uses them:

  1. Requires fgtclb/environment-state-manager in its own composer.json, or environment_state_manager in its own ext_emconf.php.
  2. Replaces the namespace prefix with \FGTCLB\EnvironmentStateManager , and \Core12\Environment and \Core13\Environment with Core12 and Core13 . The class names stay the same.
  3. Types against the ExtendedStateInterface of the running core version where it calls the TypoScriptFrontendController accessors of a state, which StateInterface no longer declares.

See Deprecation: Internal environment / state-manager subsystem moved to own extension.

Own handlers of a TCA select field 

An itemsProcFunc handler that is reached through GetSelectItemsForTcaManagedTableFieldMethodTrait receives the same $parameters['TSconfig'] as in the backend form now: the page TSconfig below itemsProcFunc. of the field, or null . A handler that descended through the complete page TSconfig tree to compensate reads the setting directly instead:

// Before, only through the trait
$mySetting = $parameters['TSconfig']['TCEFORM.'][$table . '.'][$field . '.']['itemsProcFunc.']['mySetting'] ?? null;

// After, the same as in the backend form
$mySetting = $parameters['TSconfig']['mySetting'] ?? null;
Copied!

The parameters of \FGTCLB\AcademicBase\Event\ModifyTcaSelectFieldItemsEvent declare that entry as nullable for the same reason. See Important: The select item helper passes the field TSconfig.

The trait passes an empty $parameters['row'] now, because there is no record outside the backend form, and the event declares row optional. A listener of the event reads the row, and every field of it, with a fallback:

$row = $parameters['row'] ?? [];
$pageId = (int)($row['pid'] ?? $parameters['effectivePid']);
Copied!

See Important: The select item helper passes an empty row.

The event now declares the other parameters as TYPO3 passes them, as the PHPStan type alias ItemsProcFuncParameters . inlineParentUid and inlineTopMostParentUid are the empty string '' for a record that is not edited as an inline child and a NEW... string for a parent that is not saved yet, site is a NullSite for a record outside any site, and an item TYPO3 built is a SelectItem . A listener casts an inline uid, checks the site, and types an item as array|SelectItem :

$parentUid = (int)($parameters['inlineParentUid'] ?? 0);
Copied!

See Important: The select item event declares what TYPO3 passes.

Check the result 

  • The new content element wizard shows the group Academic with its label on every site.
  • On a classic installation, environment_state_manager is listed as active in Admin Tools > Extensions.
  • Open an existing academic content element on a page where its component is not enabled. The field Type shows the stored type followed by (not enabled on this page), and saving the record keeps it. This holds for the content elements of every academic extension, as long as academic_base 2.4 is installed.
  • A content element whose type was rewritten before the update is not repaired, because its former type is not stored in the record. Its record history shows the change for as long as the history is kept. Correct the type by hand there. See Important: A hidden academic content type stays selected.
  • A search of the site package and of own extensions for TsConfig/Wizards, Sets/AcademicBaseCTypeGroup and AcademicBaseEnvironment finds nothing any more.