Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MAINTENANCE] Add support for Typo3 v12 (fixes #900) #1337

Merged
merged 24 commits into from
Oct 10, 2024

Conversation

thomaslow
Copy link
Contributor

@thomaslow thomaslow commented Sep 17, 2024

Changes

The following changes have been implemented:

  • Update composer.json for Typo3 v12
  • Add missing dependency for typo3/cms-scheduler
  • Add version restriction for phpunit v9 (phpunit v10 has breaking changes)
  • Upgrade dependency typo3/testing-framework to v7, which is compatible with Typo3 v11 and v12
  • Fix basic problems with extension configuration (see Typo3 Feature #96733)
  • Replace TYPO3_MODE references (see Typo3 Deprecation #92947)
  • Remove phpstan ignore rule TYPO3_MODE not found, which is not required any more
  • Fix flash message rendering (see Typo3 Depcrecation #97787)
  • Fix SolrSearch implementation by extending from Query class (see Typo3 Breaking #96044)
  • Avoid initialization via constructor in AbstractController (see Typo3 Deprecation #99615)
  • Fix NewTenantController by using dependency injection (see Typo3 Manual)
  • Return ResponseInterfaces in controller actions (see Typo3 Deprecation #92784)
  • Change forward calls to redirect in controller classes (see Typo3 Deprecation #92815)
  • Remove reference to old ObjectManager (see Typo3 Deprecation #94619)
  • Determine login status via Context class instead of $GLOBALS["TSFE"] (see Typo3 Manual)
  • Update GitHub CI tests to Typo3 v11 (with PHP 7.4) and v12 (with PHP 8.1)
  • Remove columns cruser_id, t3ver_oid, t3ver_wsid, t3ver_state, t3ver_stage from test fixtures, which are not available in Typo3 v12 any more (see Typo3 Breaking #98024)
  • Fix OAI-PMH template in case of request without verb or other parameters
  • Fix various undefined array key issues that are raised when using PHP 8+
  • Fix session_id length in tx_dlf_basket table, which has more then 32 characters since Typo3 v10.4, see ext_tables.sql for Typo3 frontend module.
  • Fix url parameter not added in navigation and toc links in Typo3 v12, see Typo3 Feature #98488

Todo

The following tasks still need to be done before merging:

Tests

The following tests have been done for a fresh installation of both Typo3 v11 and Typo3 v12:

General

  • Unit and functional tests
  • Triggering functions Create default namespaces, Create structures, Create metadata, Create solr rore on New Tenant admin page
  • Index several documents from URLs of METS files via kitodo:index
  • Re-index all documents via kitodo:reindex --all
  • Harvest documents from a OAI baseurl via kitodo:harvest
  • Create new Typo3 pages and add Kitodo Plugins
  • Test output of Kitodo Plugins with kitodo-demo theme, see below

Kitodo Plugins

  • Kitodo: Collection
    • has problems: same in master
  • Kitodo: Search
    • seems to work: forwards to page containing Kitodo: List View, shows facets, facets can be selected
  • Kitodo: List View
    • seems to work: shows search results, forwards to page containing Kitodo: PageView
  • Kitodo: PageView
    • seems to work: image visible, can be zoomed
  • Kitodo: Navigation
    • seems to work: shows navigation elements, other pages can be selected
  • Kitodo: Feeds
    • seems to work: shows RSS feed with documents
  • Kitodo: OAI-PMH Interface
    • has problems: shows XSLT transformed OAI-PMH responses, but no records (same in master)
  • Kitodo: Table of Contents
    • seems to work: toc is shown, sections can be selected
  • Kitodo: Basket
    • seems to work: add document to basket, can show basket
  • Kitodo: Metadata
    • seems to work: shows metadata of document in page view
  • Kitodo: Page Grid
    • seems to work: shows page thumbnails, can navigate to page
  • Kitodo: Calendar
    • seems to work: shows years, shows months, newspaper issue can be selected

Unable to test

  • Kitodo: Statistics
  • Kitodo: Embedded 3d Viewer
  • Kitodo: AudioPlayer
  • Kitodo: Toolbox
  • Kitodo: Basket (pdf generation)

Unfortunately, I do not have access or experience with a production system of kitodo-presentation. Because of that, I'm not sure whether some of the issues are the result of a misconfiguration of my Typo3 installation. All problems listed above also occur with the current master and my Typo3 installation. I would appreciate any help in testing my changes or tips to correctly set up Typo3 pages and Kitodo-Presentation plugins for testing.

Demo

Demonstration of kitodo-presentation updated for Typo3 v12 with demo theme (please ignore CSS problems)

2024-09-24_Kitodo-Presentation_Typo3-v12_Demo.mp4

- Update composer.json for Typo3 v12
- Add missing dependency for `typo3/cms-scheduler`
- Add version restriction for phpunit v9 (phpunit v10 has breaking changes)
- Upgrade dependency `typo3/testing-framework` to v7, which is compatible with Typo3 v11 and v12
- Fix basic problems with extension configuration (see Typo3 Feature #96733)
- Replace `TYPO3_MODE` references (see Typo3 Deprecation #92947)
- Remove phpstan ignore rule `TYPO3_MODE not found`, which is not required any more
- Fix flash message rendering (see Typo3 Depcrecation #97787)
- Fix `SolrSearch` implementation by extending from `Query` class (see Typo3 Breaking #96044)
- Avoid initialization via constructor in `AbstractController` (required to access $request when migrating to v13, see Typo3 Deprecation #99615)
- Fix NewTenantController by using dependency injection (see Typo3 Manual)
- Return ResponseInterfaces in controller actions (see Typo3 Deprecation #92784)
- Change `forward` calls to `redirect` in controller classes (see Typo3 Deprecation #92815)
- Remove reference to old `ObjectManager` (see Typo3 Deprecation #94619)
- Determine login status via Context class instead of `$GLOBALS["TSFE"]` (see Typo3 Manual)
- Update GitHub CI tests to Typo3 v11 (with PHP 7.4) and v12 (with PHP 8.1)
- Remove columns `cruser_id`, `t3ver_oid`, `t3ver_wsid`, `t3ver_state`, `t3ver_stage` from test fixtures, which are not available in Typo3 v12 any more (see Typo3 Breaking #98024)
- Fix OAI-PMH template in case of request without verb or other parameters
- Fix various undefined array key issues that are raised when using PHP 8+
 Typo3 v12 changes `addQueryString` parameter, see Typo3 Feature #98488.
@sebastian-meyer sebastian-meyer linked an issue Sep 20, 2024 that may be closed by this pull request
@sebastian-meyer sebastian-meyer added ⚙ feature A new feature or enhancement. 🛠 maintenance A task to keep the code up-to-date and manageable. labels Sep 20, 2024
@thomaslow thomaslow marked this pull request as ready for review September 24, 2024 12:28
@sebastian-meyer
Copy link
Member

Hm, some parent classes method's signature for some of the classes in Classes/Validation have changed from TYPO3 v11 to v12. So the tests for v12 fail, because our classes don't explicitly declare the same parameter and return types as the TYPO3's parent classes. But if I add the type declarations, the tests for v11 fail, because now their signatures don't match with the parent classes in v11.
Any idea how we could avoid that? Maybe don't use declare(strict_types=1); in those classes?

@sebastian-meyer
Copy link
Member

Also pinging @markusweigelt, because he is the author of the validator feature.

@thomaslow
Copy link
Contributor Author

@sebastian-meyer Thanks for trying to merge. I'll have to look at this in more detail. It may be related to Breaking Change 96998.

@markusweigelt
Copy link
Contributor

Thank you for your implementations. I will test the 'Embedded 3D Viewer' later this week with your update.

Regarding the validation:
Should we support both versions? It seems that security releases for TYPO3 11.5 are ending this month.

https://docs.typo3.org/c/typo3/cms-core/main/en-us/Changelog/12.0/Breaking-96998-ExtbaseValidatorInterfaceChanged.html#migration has some hint how to handle both versions.

@sebastian-meyer
Copy link
Member

Yes, if it is possible we should support both versions. There are some users who will use the ELTS version of TYPO3 v11 before migrating to v12.

I reverted my changes in master. All validation classes are now again working for v10 and v11, but not for v12.

@thomaslow
Copy link
Contributor Author

@sebastian-meyer Unit and integration tests work again with both Typo3 v11 and v12. Please let me know in case I can help some more.

@sebastian-meyer
Copy link
Member

Thank you very much! I'll review this tomorrow!

Copy link
Member

@sebastian-meyer sebastian-meyer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Outstanding work! Thank you very much!

I'll properly separate branches for 5.x and 6.x development and then this can be merged.

@sebastian-meyer sebastian-meyer merged commit 4e77a8f into kitodo:master Oct 10, 2024
6 of 7 checks passed
@thomaslow
Copy link
Contributor Author

@sebastian-meyer I'm glad my changes work for you. Please let me know in case any issues pop up that I missed. Of course, I'll occasionally check the issue list myself in the following weeks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
⚙ feature A new feature or enhancement. 🛠 maintenance A task to keep the code up-to-date and manageable.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FUND] Support for TYPO3 12 LTS
3 participants