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:

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'
Copied!

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, then update academic_base and academic_study_plan there, in this order. Run the commands of this page with typo3/sysext/core/bin/typo3 instead of vendor/bin/typo3 .

vendor/bin/typo3 cache:flush
Copied!

Update the database 

The column credit_points of the tables tx_academicstudyplan_domain_model_semester and tx_academicstudyplan_domain_model_module changes from int(11) to decimal(10,2) unsigned . 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
Copied!

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%';
Copied!

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_template 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/academic-study-plan-default needs no change. The set is an alias of the new aggregate fgtclb/academic-study-plan 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:academic_study_plan/Configuration/TypoScript/Includes/ContentElement.typoscript EXT:academic_study_plan/Configuration/TypoScript/ContentElement/setup.typoscript
EXT:academic_study_plan/Configuration/TypoScript/Includes/Page.typoscript EXT:academic_study_plan/Configuration/TypoScript/ContentElement/setup.typoscript
EXT:academic_study_plan/Configuration/TsConfig/Default.tsconfig EXT:academic_study_plan/Configuration/TSconfig/ContentElement/page.tsconfig
EXT:academic_study_plan/Configuration/TsConfig/Includes/academic-study-plan.tsconfig EXT:academic_study_plan/Configuration/TSconfig/ContentElement/page.tsconfig
EXT:academic_study_plan/Configuration/Sets/AcademicStudyPlan/setup.typoscript EXT:academic_study_plan/Configuration/TypoScript/ContentElement/setup.typoscript
EXT:academic_study_plan/Configuration/Sets/AcademicStudyPlan/page.tsconfig EXT:academic_study_plan/Configuration/TSconfig/ContentElement/page.tsconfig

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:academic_study_plan/Configuration/TypoScript/ContentElement/setup.typoscript, see Deprecation: The static template path of version 2.3.

The setup reads constants now. Import EXT:academic_study_plan/Configuration/TypoScript/ContentElement/constants.typoscript 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.typoscript of that folder as well.

Template paths 

The Fluid root paths of the content element are constants now: plugin.tx_academicstudyplan.view.templateRootPath , partialRootPath and layoutRootPath . An override of tt_content.academic_study_plan.templateRootPaths keeps working. Setting the constants is the shorter way.

Label overrides 

Label overrides are read from plugin.tx_academicstudyplan now, no longer from plugin.tx_academic_study_plan . Move them:

# Before
plugin.tx_academic_study_plan._LOCAL_LANG.default.credits = ECTS

# After
plugin.tx_academicstudyplan._LOCAL_LANG.default.credits = ECTS
Copied!

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:academic_study_plan/Resources/Public/Css/academic-study-plan.css EXT:academic_study_plan/Resources/Public/Css/frontend/academic-study-plan.css
EXT:academic_study_plan/Resources/Public/JavaScript/academic-study-plan.js EXT:academic_study_plan/Resources/Public/JavaScript/frontend/academic-study-plan.js

See Breaking: The frontend assets are built and moved.

The template 

One template file changed in 2.4, Resources/Private/Frontend/Default/Templates/AcademicStudyPlan.html. 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/Private/:

File What changed Entry
Frontend/Default/Templates/AcademicStudyPlan.html Renders through <f:layout name="Default" /> and wraps its markup in <f:section name="Main"> . It no longer renders the partial Header/All, 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/Default/Templates/AcademicStudyPlan.html Renders the icons with the identifiers academic-study-plan-plus, academic-study-plan-minus and academic-study-plan-close. The identifiers plus, minus and close-button of version 2.3 are registered by neither TYPO3 nor this extension. Important: The study plan controls are visible
Frontend/Default/Templates/AcademicStudyPlan.html Translates the labels with extensionName: 'AcademicStudyPlan' , which is what makes the label overrides of the previous step apply. Important: Label overrides are read from the documented path
Frontend/Default/Templates/AcademicStudyPlan.html 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-study-plan wrapper now, inside the frame of the layout. A selector such as .academic-study-plan header becomes .frame-type-academic_study_plan header .
  • The icon markup carries the classes .icon-academic-study-plan-plus and .icon-academic-study-plan-minus instead of .icon-plus and .icon-minus . A site package that registered icons named plus, minus or close-button for this element can drop them.
  • A category title is rendered as text. A site that put markup into a category title to style its filter button styles .filter button instead, 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 Default layout. 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.