Upgrading from 2.3 to 2.4
Version 2.4 delivers the configuration of academic_contacts4pages per component, hides its content element until a site enables it and gives a contact a position of its own in its contract and in its contacts role. A new upgrade wizard migrates the content elements of version 1.x. 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_contacts4pages 2.4 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 and academic_persons 2.4 require. Composer installs it on its own. A classic installation installs environment_state_manager before it activates either of them.
- fgtclb/academic-base 2.4, the same release as this extension.
- fgtclb/academic-persons 2.4, the same release as this extension. Its upgrade chapter has steps of its own.
The extension now declares the system extension install as a dependency, for its upgrade wizards. TYPO3 keeps that extension active in every installation, so this needs no action.
Update the package
composer require -W \
'fgtclb/academic-base':'~2.4.0' \
'fgtclb/academic-persons':'~2.4.0' \
'fgtclb/academic-contacts4pages':'~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, academic_persons and
academic_contacts4pages there, in this order. Run the commands of
this page with
typo3/ instead of
vendor/.
vendor/bin/typo3 cache:flush
Update the database
Apply the database changes in Admin Tools > Maintenance > Analyze Database Structure, or on the command line:
vendor/bin/typo3 extension:setup
For this extension the comparison adds five columns to
tx_:
contract_andsorting role_, the order of a contact in its contract and in its contacts role. Until the wizard of the next section fills them, both holdsorting 0, see Important: Contracts and contacts roles sort their contacts on their own.email_,address phone_andnumber physical_, the address records a contact displays. The defaultaddress 0means Display all, the output of every existing contact, see Feature: Dedicated selection of address records.
The language columns of the table are declared in its TCA now. They exist already, so the schema does not change for them, see Important: Translations of page contacts keep their parent.
Run the upgrade wizards
Both wizards need the database changes of the previous section. Run them in this order, in Admin Tools > Upgrade > Upgrade Wizard or on the command line. Mind the identifiers, the first one is spelled without the s of Contacts.
-
academic, Seed the contact sort order of contracts and contacts roles. It fills the two new sort columns with the order the contract and contacts role forms show today. Run it right after the database comparison: until it has run, every contact holdsContact4pages_ seed Contact Secondary Sorting 0in both columns, and a contact saved in the backend gets no position of its own in those lists. Running it again is harmless.vendor/bin/typo3 upgrade:run academicContact4pages_seedContactSecondarySortingCopied!See Important: Contracts and contacts roles sort their contacts on their own.
-
academic, Migrate the academic_contacts4pages plugins of version 1.x. It renames the content typeContacts4pages_ plugin Upgrade Wizard academiccontacts4pages_of version 1.x tocontactslist academiccontacts4pages_in every content element, and carries the permission of backend user groups over. It replaceslist academicof versions 2.0 to 2.3, which looked for a misspelled type and never migrated anything. The new wizard is a new class, and TYPO3 records a wizard as done by its class, so it is offered also where the old one is marked done. It is offered only while a content element or a backend user group of version 1.x is left, so an installation that started with 2.0 or later never sees it.Contact4pages_ plugin Upgrade Wizard vendor/bin/typo3 upgrade:run academicContacts4pages_pluginUpgradeWizardCopied!TypoScript, page TSconfig or templates of a site package that name the old type change it to
academiccontacts4pages_by hand. See Important: A new upgrade wizard migrates the plugins of version 1.x and Upgrading from version 1.x.list
Adapt the configuration
The TypoScript and the page TSconfig are now delivered per content element, and the Contacts for this page content element is hidden in the whole installation until the page TSconfig of its component is included. See Breaking: Site sets and static templates have been restructured.
Include the components
- Site set, TYPO3 13 only. A site that depends on the set
fgtclb/needs no change. The set keeps its name and now brings the page TSconfig along.academic- contacts4pages - Static template. The stored entry of 2.3 keeps working as Academic Contacts4Pages: Path up to 2.3 (deprecated, use All components) (academic_contacts4pages), which is removed in version 4.0. Replace it with Academic Contacts4Pages: All components (academic_contacts4pages) in the field Include TypoScript sets on the tab Advanced Options of the template record. That entry brings the shared plugin settings of academic_persons along, so remove a separate entry Academic Persons: Shared plugin settings (academic_persons), called Academic Persons Settings (academic_persons) in 2.3, from the same record. See Deprecation: The static template path of version 2.3.
- Page TSconfig. A site without the site set, which is every site on TYPO3 12, adds Academic Contacts4Pages: All components (academic_contacts4pages) in the field Include static Page TSconfig (from extensions) on the tab Resources of its root page, see Include static page TSconfig. Without it the content element is not offered for new content.
- Use one of the two mechanisms per site, see Do not combine both.
Until the component is included, an existing content element keeps rendering and keeps its type: academic_base 2.4 shows the stored type in the field Type followed by (not enabled on this page), and saving keeps it. The warning of the changelog entry that saving such a record rewrites its type describes the state before that fix. A content element that an older version or a page TSconfig of your own already turned into another type is not repaired. Correct it by hand from its record history.
Adjust your own configuration
- The page TSconfig directory is
Configuration/now, and the TypoScript moved intoTSconfig/ Configuration/. Take the new path of everyTypo Script/ List/ @importfrom the table of Breaking: Site sets and static templates have been restructured. An import of a missing file fails silently. -
The setup reads three constants now, the Fluid root paths of the plugin. A site package that imports a
setup.of this extension imports thetyposcript constants.of the same folder into its constants as well, otherwise the plugin fails with a missing template:typoscript TypoScript constants of the site package@import 'EXT:academic_contacts4pages/Configuration/TypoScript/List/constants.typoscript'Copied! - A site package that replaces the shipped setup with a copy of its own adds
plugin.to the copy. Existing content elements store no value for the new option Group by role and read this default, see Feature: Optional role grouping and one partial per contact.tx_ academiccontacts4pages. settings. group By Role = 1 - On TYPO3 12, add
tx_to the allowed excludefields of every backend user group whose members set the language of a page contact, see Important: Translations of page contacts keep their parent.academiccontacts4pages_ domain_ model_ contact: sys_ language_ uid
Adapt templates and assets
A copy of a template or partial in a site package keeps rendering the copy, so
compare each copy with the shipped file and take over the changes. The paths
below are relative to Resources/:
| File | What changed | Entry |
|---|---|---|
Templates/ | Contacts without a role are rendered after the role groups, from
the new variable
{contacts. The option
Group by role switches the role groups off, and every
contact renders through the new partial
Partials/. | Important: Contacts without a role are listed too, Feature: Optional role grouping and one partial per contact |
Partials/ | New. A site package that already ships a partial of that name in a partial root path of this plugin has it rendered for every contact now. Rename it, or turn it into the contact card. | Feature: Optional role grouping and one partial per contact |
Partials/ of
academic_persons | The name leaves out an empty middle name, which a copy of the
partial takes over in its
header
argument. | Important: Contact names leave out an empty middle name |
The view variable
{contacts}
is a plain list now, no query result. A
template that reads
{contacts. gets nothing, see
Important: Contacts without a visible profile are skipped.
No asset of this extension changed.
Adapt your code
- A class that extends
\FGTCLB\and overridesAcademic Contacts4pages\ Domain\ Repository\ Contact Repository findadds the parameterBy Pid () bool $show, see Breaking: Extended ContactRepository::findByPid() signature.Hidden = false \FGTCLB\is removed. Own TCA or FlexForm configuration usesAcademic Contacts4pages\ Backend\ Form Engine\ Contract Items Proc Func \FGTCLB\instead, see Breaking: Removed duplicated ContractItemsProcFunc in EXT:academic_contacts4pages.Academic Persons\ Backend\ Form Engine\ Contract Items->items Proc Func - A subclass of
\FGTCLB\that is named in TypoScript has to be autowired by theAcademic Contacts4pages\ Data Processing\ Contacts Processor Services.of its site package, because the processor takes its collaborator through the constructor now. Code that reads the contacts of the processor or the plugin as a query result accepts a list. See Important: Contacts without a visible profile are skipped.yaml
Check the result
- The Contacts for this page content element is offered for new content on the pages that should have it, and existing ones keep their type.
- The order of the contacts on a page, in a contract and in a contacts role stays as it was after one of them is saved.
- Pages that mix contacts with and without a role list all of them.
- On TYPO3 12, translations of page contacts that an import created may point at a wrong original. The query in Important: Translations of page contacts keep their parent finds them.
- Translated contacts may point at a translation of their contacts role, and localizing a contacts role may have left duplicates. The queries in Important: Translated contacts keep their contacts role find both.
- The address selects of a page contact are relations now. Existing page
contacts get their rows in the reference index on their next save, or at
once with
vendor/.bin/ typo3 referenceindex: update