Upgrading from 2.3 to 2.4
Version 2.4 cuts the configuration of the study plan into components, moves its
page TSconfig and its frontend assets, turns the credit points into a decimal
column and renders the content element through the Default layout. The
page TSconfig entry decides whether editors can still select the content
element after the update. 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_study_plan 2.4 declares no new dependency of its own. It needs these packages. Upgrade them first or in the same deployment, in this order:
- fgtclb/environment-state-manager 1.x, new in 2.4, which academic_base 2.4 requires. Composer installs it on its own. A classic installation installs environment_state_manager before it activates academic_base 2.4.
- fgtclb/academic-base 2.4, the same release as this extension.
Plan the configuration step of the page TSconfig into the same deployment as the package update. On every site that selects the page TSconfig of version 2.3, the content element is not offered to editors until it is done.
Update the package
composer require -W \
'fgtclb/academic-base':'~2.4.0' \
'fgtclb/academic-study-plan':'~2.4.0'
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, then update
academic_base and academic_study_plan there, in this
order. Run the commands of this page with
typo3/
instead of
vendor/.
vendor/bin/typo3 cache:flush
Update the database
The column
credit_ of the tables
tx_ and
tx_ changes from
int to
decimal. Run the database compare right after the package
update, before editors enter a decimal value, which the integer column cannot
hold on MariaDB, MySQL and PostgreSQL:
vendor/bin/typo3 extension:setup
Or use Admin Tools > Maintenance > Analyze Database Structure and apply the change of the column in both tables. The change rewrites both tables and keeps every stored value. Nothing is added or dropped.
An installation that redefined the column in an ext_tables.sql of its
own removes that definition before the compare, or the column stays as it is. A
TCA override that only adds
'format' => 'decimal'
to the field can go.
See Important: Study plan credit points take decimals.
Adapt the configuration
All of this step is described in Breaking: Site sets and static templates have been restructured. The deprecated static template path is described in Deprecation: The static template path of version 2.3.
Page TSconfig of the content element
The content element is hidden for the whole installation, as it was in 2.3, and the page TSconfig of its component brings it back. The file version 2.3 registered for the page field Include static Page TSconfig (from extensions) is gone, and the value a page record stored for it is not rewritten. It simply stops resolving, without a message, and the content element is no longer offered on that page tree.
On TYPO3 12, and on TYPO3 13 for a site that does not depend on the site set of this extension, edit the page record of every site root that selected Academic StudyPlan (Default) (academic_study_plan), tab Resources, field Include static Page TSconfig (from extensions). Remove the old entry and select Academic Study Plan: All components (academic_study_plan) instead. This query lists the page records that still store the old value:
SELECT uid, pid, title FROM pages
WHERE tsconfig_includes LIKE '%academic_study_plan/Configuration/TsConfig/Default.tsconfig%';
See Important: The page TSconfig directory is now spelled TSconfig as well.
An existing study plan opened on a page where the content element is not enabled keeps its type. The field Type shows it followed by (not enabled on this page), and saving the record keeps it, as long as academic_base 2.4 is installed. The warning of the Breaking entry linked above, that saving such a record writes another type, no longer applies. A study plan whose type was rewritten that way before the update is not repaired. Its record history shows the change, and the type is corrected by hand there.
Static template
A
sys_ record that selected Academic StudyPlan
(Default) in its field Include TypoScript sets on the tab
Advanced Options keeps delivering the content element. The entry
is listed as Academic Study Plan: Path up to 2.3 (deprecated, use
All components) (academic_study_plan) now and is removed in version 4.0.
Replace it with Academic Study Plan: All components
(academic_study_plan). On TYPO3 12 the static template is the only way to
deliver the TypoScript of the content element.
Site sets
On TYPO3 13, a site that depends on
fgtclb/
needs no change. The set is an alias of the new aggregate
fgtclb/ now, which can be named instead.
A site uses the site set or the static template, not both. With both, the static template sets the three new template path constants back to their defaults after the site settings, see Do not combine both.
Imports in a site package
An
@import
of a file that moved loads nothing and reports no
error. Replace the old paths:
| Old path | New path |
|---|---|
EXT: | EXT: |
EXT: | EXT: |
EXT: | EXT: |
EXT: | EXT: |
EXT: | EXT: |
EXT: | EXT: |
The file Configuration/TypoScript/Default/setup.typoscript still exists.
It is deprecated, keeps delivering the content element and is removed in
version 4.0. Replace an import of it with
EXT:,
see Deprecation: The static template path of version 2.3.
The setup reads constants now. Import
EXT:
into the constants of the same template, or the content element cannot find its
template. That also applies to a site package that keeps importing the
deprecated Configuration/TypoScript/Default/setup.typoscript: it imports
the constants. of that folder as well.
Template paths
The Fluid root paths of the content element are constants now:
plugin.,
partial and
layout. An override of
tt_ keeps working.
Setting the constants is the shorter way.
Label overrides
Label overrides are read from
plugin. now, no
longer from
plugin.. Move them:
# Before
plugin.tx_academic_study_plan._LOCAL_LANG.default.credits = ECTS
# After
plugin.tx_academicstudyplan._LOCAL_LANG.default.credits = ECTS
See Important: Label overrides are read from the documented path and the list of labels in Labels.
Adapt templates and assets
Asset paths
The stylesheet and the script of the content element moved into a
frontend/ folder. The extension loads them from there itself. Only own
TypoScript, a site package or a template override that names one of the files
has to add the folder:
| Old path | New path |
|---|---|
EXT: | EXT: |
EXT: | EXT: |
The template
One template file changed in 2.4,
Resources/. No
partial or layout of the extension changed, and none was removed. A copy of the
template in a site package keeps rendering, but misses these changes. Compare it
with the 2.4 file and take them over. The paths below are relative to
Resources/:
| File | What changed | Entry |
|---|---|---|
Frontend/ | Renders through
<f: and wraps its
markup in
<f:. It no longer renders the
partial Header/, because the layout renders the header.
A copy made only to add the layout can be dropped. | Important: The study plan renders through the Default layout |
Frontend/ | Renders the icons with the identifiers academic-,
academic- and academic-. The
identifiers plus, minus and close- of version 2.3 are
registered by neither TYPO3 nor this extension. | Important: The study plan controls are visible |
Frontend/ | Translates the labels with
extension, which is what makes the
label overrides of the previous step apply. | Important: Label overrides are read from the documented path |
Frontend/ | The hidden text of the module button names the note and the credit points of a semester only when the semester has them. | Important: Module buttons announce only what a semester has |
Site stylesheets
- The header of the content element sits above the
.academic-wrapper now, inside the frame of the layout. A selector such asstudy- plan .academic-becomesstudy- plan header .frame-.type- academic_ study_ plan header - The icon markup carries the classes
.icon-andacademic- study- plan- plus .icon-instead ofacademic- study- plan- minus .icon-andplus .icon-. A site package that registered icons namedminus plus,minusorclose-for this element can drop them.button - A category title is rendered as text. A site that put markup into a
category title to style its filter button styles
.filter buttoninstead, see Important: A study plan category title is text, not markup.
Check the result
- The new content element wizard offers Academic Study Plan on every site that should offer it.
- Existing study plans render, with their credit points unchanged. A semester or module accepts a credit point value such as 2.5 in the backend.
- The study plan renders inside the frame of the
Defaultlayout. The settings of the tab Appearance take effect now, and on an installation whose editors used that tab long ago, spacing, frames and the Link to top link may appear where they were chosen. - The plus and minus markers of the semesters on a narrow viewport and the close button of a module dialog are visible.
- The browser loads the stylesheet and the script of the study plan from the
frontend/folders without an error.