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:
-
fgtclb/environment-state-manager
1.x, the extension
environment_state_manager. It is declared in
composer.asjson ^1.and in0 ext_asemconf. php 1., see Important: New required dependency fgtclb/environment-state-manager. Composer installs it on its own. A classic installation installs it before it activates academic_base 2.4.0. 0- 1. 99. 99
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'
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. keeps
an inline alias such as 2. 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/ instead of
vendor/.
vendor/bin/typo3 cache:flush
Adapt the configuration
Page TSconfig imports
The page TSconfig that labels the content element group Academic
moved, and the directory Configuration/ is spelled
Configuration/ 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: | EXT: |
EXT: | EXT: |
EXT: | EXT: |
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/ keeps its name, and the new aggregate
set
fgtclb/ 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
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\,
\FGTCLB\ and
\FGTCLB\ 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:
- Requires
fgtclb/environment-state-manager
in its own
composer., or environment_state_manager in its ownjson ext_.emconf. php - Replaces the namespace prefix with
\FGTCLB\, andEnvironment State Manager \Core12\andEnvironment \Core13\withEnvironment Core12andCore13. The class names stay the same. - Types against the
Extendedof the running core version where it calls the TypoScriptFrontendController accessors of a state, whichState Interface Stateno longer declares.Interface
See Deprecation: Internal environment / state-manager subsystem moved to own extension.
Own handlers of a TCA select field
An
items handler that is reached through
Get receives the same
$parameters as in the backend form now: the page TSconfig
below
items 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;
The parameters of
\FGTCLB\ 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 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']);
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
Items.
inline and
inline 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
Null for a record outside any site, and
an item TYPO3 built is a
Select. A listener casts an inline uid,
checks the site, and types an item as
array:
$parentUid = (int)($parameters['inlineParentUid'] ?? 0);
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
Ts,Config/ Wizards Sets/andAcademic Base CType Group Academicfinds nothing any more.Base Environment