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] Update to TYPO3 12 #322

Open
wants to merge 31 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 7 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
f7e5b38
Update Typo3
markusweigelt Oct 18, 2024
9a00d01
Merge branch 'slub:master' into update-typo12
markusweigelt Oct 21, 2024
b6043dc
Updates Typo3 12
markusweigelt Oct 21, 2024
7ebde4e
Updates regarding typo3 12
markusweigelt Oct 21, 2024
f15155c
Update PHPDoc
markusweigelt Oct 21, 2024
fe5653c
Move icon to icons for reusage in TYPO3 backend
markusweigelt Oct 21, 2024
0240042
Update documentation
markusweigelt Oct 21, 2024
5aef709
Update documentation
markusweigelt Oct 22, 2024
f24f910
Remove unused code
markusweigelt Oct 22, 2024
42a067a
Improve response type
markusweigelt Oct 22, 2024
c408506
Update composer
markusweigelt Oct 22, 2024
a8a73a0
Update codeql workflow
markusweigelt Oct 22, 2024
d3d9181
Update PHP Stan
markusweigelt Oct 22, 2024
005e28b
Update improvements
markusweigelt Oct 23, 2024
93fb538
Refactore UriController to reduce complexity
markusweigelt Oct 23, 2024
b6a3e62
Get page id by rooting request attribute
markusweigelt Oct 23, 2024
b7adb24
Fix PHPDoc
markusweigelt Oct 23, 2024
9c6ef21
Fix hasty change from to getTSFE()?, improve font paths
markusweigelt Oct 25, 2024
9674cba
Change typo conversion
markusweigelt Oct 28, 2024
c0bc0dd
Remove typo
markusweigelt Oct 28, 2024
0afa7e0
Update doc
markusweigelt Oct 28, 2024
6dce0e5
Update doc
markusweigelt Oct 28, 2024
4f7a537
Update doc
markusweigelt Oct 28, 2024
2a45b14
Update webstyles
markusweigelt Oct 28, 2024
316e400
Update site configuration of default distribution
markusweigelt Oct 29, 2024
7b35945
Rename site config yaml
markusweigelt Oct 29, 2024
f15f485
Add dev
markusweigelt Nov 4, 2024
048e938
Remove dev version
markusweigelt Nov 4, 2024
a75f40f
Show replacement of composer.json
markusweigelt Nov 12, 2024
22b4c8d
Merge branch 'master' into update-typo12
markusweigelt Nov 14, 2024
8be3721
Fix wrong required extension change
markusweigelt Nov 14, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 25 additions & 20 deletions Classes/Controller/UriController.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
***************************************************************/

use Kitodo\Dlf\Common\Helper;
use TYPO3\CMS\Core\Utility\MathUtility;
use Kitodo\Dlf\Controller\AbstractController;
use Psr\Http\Message\ResponseInterface;
use TYPO3\CMS\Core\Utility\GeneralUtility;

/**
Expand All @@ -37,21 +38,21 @@
* @subpackage dlf
* @access public
*/
class UriController extends \Kitodo\Dlf\Controller\AbstractController
class UriController extends AbstractController
{
/**
* The main method of the plugin
*
* @return void
* @return ResponseInterface
*/
public function mainAction()
public function mainAction(): ResponseInterface
{
// Load current document.
$this->loadDocument();

if ($this->isDocMissingOrEmpty()) {
// Quit without doing anything if required variables are not set.
return;
return $this->htmlResponse();
}

$this->setPage();
Expand Down Expand Up @@ -84,26 +85,30 @@ public function mainAction()
}
}

// Get persistent identifier of page.
$uriPage = GeneralUtility::trimExplode(' ', $doc->physicalStructureInfo[$doc->physicalStructure[$this->requestData['page']]]['contentIds'], TRUE);
if (isset($this->requestData['page'])) {
// Get persistent identifier of page.
$uriPage = GeneralUtility::trimExplode(' ', $doc->physicalStructureInfo[$doc->physicalStructure[$this->requestData['page']]]['contentIds'], TRUE);

if (!empty($uriPage)) {
$uris = [];
if (!empty($uriPage)) {
$uris = [];

foreach ($uriPage as $uri) {
if (Helper::isValidHttpUrl($uri)) {
$uris[] = $uri;
} elseif (strpos($uri, 'urn:') === 0) {
if (strpos($uri, '/fragment/') === false) {
$uris[] = 'https://nbn-resolving.de/' . $uri;
} else {
$uris[] = 'https://nbn-resolving.org/' . $uri;
foreach ($uriPage as $uri) {
if (Helper::isValidHttpUrl($uri)) {
$uris[] = $uri;
} elseif (strpos($uri, 'urn:') === 0) {
if (strpos($uri, '/fragment/') === false) {
$uris[] = 'https://nbn-resolving.de/' . $uri;
} else {
$uris[] = 'https://nbn-resolving.org/' . $uri;
}
}
}
}
if (!empty($uris)) {
$this->view->assign('uriPages', $uris);
if (!empty($uris)) {
$this->view->assign('uriPages', $uris);
}
}
}

return $this->htmlResponse();
}
}
8 changes: 8 additions & 0 deletions Configuration/Services.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
services:
_defaults:
autowire: true
autoconfigure: true
public: false

Slub\Dfgviewer\:
resource: '../Classes/*'
2 changes: 1 addition & 1 deletion Configuration/TCA/Overrides/pages.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
defined('TYPO3_MODE') or die();
defined('TYPO3') or die('Access denied.');

\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::registerPageTSConfigFile (
'dfgviewer',
Expand Down
2 changes: 1 addition & 1 deletion Configuration/TCA/Overrides/sys_template.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
defined('TYPO3_MODE') or die();
defined('TYPO3') or die('Access denied.');

// Register static typoscript.
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addStaticFile(
Expand Down
2 changes: 1 addition & 1 deletion Configuration/TCA/Overrides/tt_content.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
defined('TYPO3_MODE') or die();
defined('TYPO3') or die('Access denied.');

// Plugin "uri".
$GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist']['dfgviewer_uri'] = 'layout,select_key,pages,recursive';
Expand Down
2 changes: 1 addition & 1 deletion Configuration/TsConfig/Page.tsconfig
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
##############
#### PAGE ####
##############
<INCLUDE_TYPOSCRIPT: source="DIR:EXT:dfgviewer/Configuration/TsConfig/Page/" extensions="tsconfig">
@import 'EXT:dfgviewer/Configuration/TypoScript/TsConfig/Page/*.tsconfig'


# PAGE DEFAULT PERMISSIONS
Expand Down
6 changes: 4 additions & 2 deletions Configuration/TypoScript/Navigation/language.typoscript
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# Header Language Navigation
# ----------------------------------------


lib.menu {
language = COA
language {
Expand All @@ -11,7 +12,7 @@ lib.menu {
# show only Default and English
special.value = 0,1

addQueryString = 1
addQueryString = untrusted
addQueryString.method = GET
addQueryString.exclude = cHash

Expand All @@ -21,7 +22,8 @@ lib.menu {
noBlur = 1
NO = 1
NO {
linkWrap=<li>|</li>
before = <li>
after = </li>
stdWrap.override = DE || EN
ATagTitle.override = Sprache: Deutsch || Language: English
}
Expand Down
2 changes: 1 addition & 1 deletion Configuration/TypoScript/Page/page.typoscript
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ page {
bodyTag = <body class="website">

adminPanelStyles = 0
shortcutIcon = EXT:dfgviewer/Resources/Public/Images/dfgviewerFavicon.png
shortcutIcon = EXT:dfgviewer/Resources/Public/Icons/Extension.png

10 = FLUIDTEMPLATE
10 {
Expand Down
11 changes: 4 additions & 7 deletions Configuration/TypoScript/setup.typoscript
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
# Configuration
<INCLUDE_TYPOSCRIPT: source="DIR:./Config/" extensions="typoscript">

@import 'EXT:dfgviewer/Configuration/TypoScript/Config/*.typoscript'
# Navigation
<INCLUDE_TYPOSCRIPT: source="DIR:./Navigation/" extensions="typoscript">

@import 'EXT:dfgviewer/Configuration/TypoScript/Navigation/*.typoscript'
# Plugin
<INCLUDE_TYPOSCRIPT: source="DIR:./Plugins/" extensions="typoscript">

@import 'EXT:dfgviewer/Configuration/TypoScript/Plugins/*.typoscript'
# Page
<INCLUDE_TYPOSCRIPT: source="DIR:./Page/" extensions="typoscript">
@import 'EXT:dfgviewer/Configuration/TypoScript/Page/*.typoscript'
26 changes: 13 additions & 13 deletions Documentation/Index.rst
markusweigelt marked this conversation as resolved.
Show resolved Hide resolved
markusweigelt marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -10,29 +10,28 @@ dfgviewer* extension.
Installation
============

The current release 6.0 may be used with TYPO3 9.5 LTS or TYPO3 10.4 LTS.
The current release 6.1 may be used with TYPO3 11.5 or TYPO3 12.4 LTS.

The extension is based on `Kitodo.Presentation (dlf) <https://github.com/kitodo/kitodo-presentation>`_. Before you can start to
The extension is based on `Kitodo.Presentation (dlf) <https://github.com/kitodo/kitodo-presentation>`_ and `SLUB DigitalCollections (slub_digitalcollections) <https://github.com/slub/slub_digitalcollections>`. Before you can start to
markusweigelt marked this conversation as resolved.
Show resolved Hide resolved
use the *DFG Viewer (dfgviewer)* in your TYPO3 installation, you have to install
both extensions. The installation is only supported via Composer.
Kitodo.Presentation will be installed and configured automatically.

System Requirements
-------------------

You need a webserver stack with Apache2 or Ngnix, PHP >= 7.3 and MySQL / MariaDB.
Debian 10 (buster) is known to work with Kitodo.Presentation 3.2 and DFG-Viewer 5.2.
You need a webserver stack with Apache2 or Nginx, PHP >= 7.4 and MySQL / MariaDB.

We recommend at least:

* CPU: 1
* Memory: 2 GB
* Disk: 20 GB

Install a fresh TYPO3 9.5 LTS
Install a fresh TYPO3 12.4 LTS
-----------------------------

To install a fresh TYPO3 9.5 system, try the following installation procedure with composer::
To install a fresh TYPO3 12.4 system, try the following installation procedure with composer::

# Assuming the following settings:
# * the installation directory is /var/www/dfgviewer
Expand All @@ -43,10 +42,10 @@ To install a fresh TYPO3 9.5 system, try the following installation procedure wi
# remove /var/www/dfgviewer if it already exist or make sure it's really empty by ls -la dfgviewer/
rm -r dfgviewer/
# load full TYPO3 via composer
composer create-project typo3/cms-base-distribution:^9.5 dfgviewer
composer create-project typo3/cms-base-distribution:^12 dfgviewer
# Install the TYPO3 system with the TYPO3-console
cd dfgviewer/
./vendor/bin/typo3cms install:setup
./vendor/bin/typo3 setup

Instead of using the TYPO3-console, you can you can switch to the web-based installation of TYPO3 in your
browser. Just follow the 4 steps. You need your MySQL/MariaDB credentials of course.::
Expand Down Expand Up @@ -81,9 +80,9 @@ Your *typo3conf/LocalConfiguration.php* must contain this::

You can set this easily with the TYPO3-console::

./vendor/bin/typo3cms configuration:set 'FE/pageNotFoundOnCHashError' 0
./vendor/bin/typo3 configuration:set 'FE/pageNotFoundOnCHashError' 0
markusweigelt marked this conversation as resolved.
Show resolved Hide resolved

Now you have a working TYPO3 9.5 LTS installation and you can continue with composer
Now you have a working TYPO3 12.4 LTS installation and you can continue with composer
to install DFG-Viewer extension.


Expand All @@ -93,17 +92,18 @@ Install DFG-Viewer and Kitodo.Presentation via Composer
Composer commands::

# make sure you haven't set the platform php version to 7.2
composer config platform.php 7.3
composer config platform.php
# install DFG-Viewer extension
composer require slub/dfgviewer:^6.0
composer require slub/dfgviewer:^6.1

This will install the DFG-Viewer 6.0 extension and Kitodo.Presentation 4.0 from
This will install the DFG-Viewer 6.1 extension and Kitodo.Presentation 5.0 from
`Packagist <https://github.com/slub/dfg-viewer>`_.

Install the Extension via extension manager or CLI::

./vendor/bin/typo3 extension:activate dlf
./vendor/bin/typo3 extension:activate dfgviewer
./vendor/bin/typo3 extension:activate slub_digitalcollections
markusweigelt marked this conversation as resolved.
Show resolved Hide resolved

During the installation, three pages will be created: a root page, the "Kitodo
Configuration" folder and the viewer itself.
Expand Down
32 changes: 32 additions & 0 deletions Initialisation/Site/dfgviewer/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
base: '/'
baseVariants: { }
errorHandling: { }
languages:
-
title: Deutsch
enabled: true
base: /
typo3Language: de
locale: de_DE.UTF-8
iso-639-1: de
navigationTitle: German
hreflang: de-DE
direction: ltr
flag: de
languageId: '0'
-
title: Englisch
enabled: true
base: /en/
typo3Language: default
locale: en_US.UTF-8
iso-639-1: en
navigationTitle: English
hreflang: en-US
direction: ltr
fallbackType: strict
fallbacks: '0'
flag: gb
languageId: '1'
rootPageId: 1
routes: { }
Loading
Loading