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

[BUGFIX] Ender preview translated flag information in TYPO3 v12 (5.x) #398

Merged
merged 1 commit into from
Dec 14, 2024

Conversation

sbuerk
Copy link
Contributor

@sbuerk sbuerk commented Dec 14, 2024

TYPO3 v12 removed the contentPostProc-all aling with other hooks
in favour of new PSR-14 AfterCacheableContentIsGeneratedEvent.

The DeeplPreviewFlagGeneratePageHook is not called in TYPO3 v12
anymore and the translated preview flag is not displayed. Changed
behavour between TYPO3 v11 and v12 was not intented and simply an
oversight to mitigate when adding TYPO3 v12 support. Sadly, this
has not been detected for quite a while now.

This change introduces a event listener for the TYPO3 v12 event,
rendering the same flag to restore the missing and wanted preview
flag while keeping the hook implementation for TYPO3 v11 instances.
Choosen strategy follows the recommended way to migrate from the
hook to the event when dual TYPO3 version support is required.

Used command(s):

Build/Scripts/runTests.sh -t 12 -p 8.1 -s composerUpdate
Build/Scripts/runTests.sh -t 12 -p 8.1 -s phpstanGenerateBaseline

[1] https://docs.typo3.org/c/typo3/cms-core/main/en-us/Changelog/12.0/Breaking-97862-HooksRelatedToGeneratingPageContentRemoved.html
[2] https://docs.typo3.org/c/typo3/cms-core/main/en-us/Changelog/12.0/Feature-97862-NewPSR-14EventsForManipulatingFrontendPageGenerationAndCacheBehaviour.html

TYPO3 v12 with this change

image

Resolves: #395

@sbuerk sbuerk changed the title [BUGFIX] Ender preview translated flag information in TYPO3 v12 [BUGFIX] Ender preview translated flag information in TYPO3 v12 (5.x) Dec 14, 2024
TYPO3 v12 removed the `contentPostProc-all` aling with other hooks
in favour of new PSR-14 `AfterCacheableContentIsGeneratedEvent`.

The `DeeplPreviewFlagGeneratePageHook` is not called in TYPO3 v12
anymore and the translated preview flag is not displayed. Changed
behavour between TYPO3 v11 and v12 was not intented and simply an
oversight to mitigate when adding TYPO3 v12 support. Sadly, this
has not been detected for quite a while now.

This change introduces a event listener for the TYPO3 v12 event,
rendering the same flag to restore the missing and wanted preview
flag while keeping the hook implementation for TYPO3 v11 instances.
Choosen strategy follows the recommended way to migrate from the
hook to the event when dual TYPO3 version support is required.

Used command(s):

```base
Build/Scripts/runTests.sh -t 12 -p 8.1 -s composerUpdate
Build/Scripts/runTests.sh -t 12 -p 8.1 -s phpstanGenerateBaseline
```

[1] https://docs.typo3.org/c/typo3/cms-core/main/en-us/Changelog/12.0/Breaking-97862-HooksRelatedToGeneratingPageContentRemoved.html
[2] https://docs.typo3.org/c/typo3/cms-core/main/en-us/Changelog/12.0/Feature-97862-NewPSR-14EventsForManipulatingFrontendPageGenerationAndCacheBehaviour.html
@sbuerk sbuerk merged commit 95d0636 into main Dec 14, 2024
4 checks passed
@sbuerk sbuerk deleted the issue-395-upport branch December 14, 2024 21:43
sbuerk added a commit that referenced this pull request Dec 14, 2024
Since TYPO3 v12 `contentPostProc-all` hook is not called and replaced
with PSR-14 event `AfterCacheableContentIsGeneratedEvent`, which has
been respected with

* #397
* #398

TYPO3 v11 support has been removed and this change cleansup introduced
dual version code with upporting the bugfix as a housekeeping change.
Further, the now obsolete hook is completly removed.

Related: #397
Related: #398
sbuerk added a commit that referenced this pull request Dec 14, 2024
Since TYPO3 v12 `contentPostProc-all` hook is not called and replaced
with PSR-14 event `AfterCacheableContentIsGeneratedEvent`, which has
been respected with

* #397
* #398

TYPO3 v11 support has been removed and this change cleansup introduced
dual version code with upporting the bugfix as a housekeeping change.
Further, the now obsolete hook is completly removed.

Related: #397
Related: #398
@sbuerk sbuerk self-assigned this Dec 14, 2024
sbuerk added a commit that referenced this pull request Dec 14, 2024
Issue #395 has been recently fixed for 4.x and 5.x
with following pull-requests:

* #397
* #398

Adding regression test has been omited due to issues within the
`typo3/testing-framework` already. The major missing part boils
down to an incomplete frontend backend user authentication setup,
reported by Daniel Siepmann [1] and provided a pull-request [2].

* [1] Issue: TYPO3/testing-framework#535
* [2] Pull-request: TYPO3/testing-framework#536

The pull-request has been adopted by providing a test-fixture
extension replacing the BackendUserHandler with a fixed version.
Sadly, this required an additional temporary workaround within
the functional test bootstrap, enforce loading package infor for
the testing-framework extensions. That needs to be fixed within
`typo3/testing-framework`, enforce loading the package info in
Testbase->linkFrameworkExtensionsToInstance` when linking the
framework extension - or refactor the linking all together.

For ongoing work to add TYPO3 v13 support we take the workarounds
to continue the work having regression test in place and do not
wait until resolved in the testing-framework which needs adoptions
in the TYPO3 monorepo and therefore some coordination in fix, release
and upgrade.

SiteBasedTestTrait related reporting for new test case are added
to the baseline for now, needs to be addressed in general with
a dedcated change.

Used command(s):

```bash
Build/Scripts/runTests.sh -t 12 -p 8.1 -s phpstanGenerateBaseline
```

Related: #395
Related: #398
Related: #397
sbuerk added a commit that referenced this pull request Dec 14, 2024
Issue #395 has been recently fixed for 4.x and 5.x
with following pull-requests:

* #397
* #398

Adding regression test has been omited due to issues within the
`typo3/testing-framework` already. The major missing part boils
down to an incomplete frontend backend user authentication setup,
reported by Daniel Siepmann [1] and provided a pull-request [2].

* [1] Issue: TYPO3/testing-framework#535
* [2] Pull-request: TYPO3/testing-framework#536

The pull-request has been adopted by providing a test-fixture
extension replacing the BackendUserHandler with a fixed version.
Sadly, this required an additional temporary workaround within
the functional test bootstrap, enforce loading package infor for
the testing-framework extensions. That needs to be fixed within
`typo3/testing-framework`, enforce loading the package info in
Testbase->linkFrameworkExtensionsToInstance` when linking the
framework extension - or refactor the linking all together.

For ongoing work to add TYPO3 v13 support we take the workarounds
to continue the work having regression test in place and do not
wait until resolved in the testing-framework which needs adoptions
in the TYPO3 monorepo and therefore some coordination in fix, release
and upgrade.

SiteBasedTestTrait related reporting for new test case are added
to the baseline for now, needs to be addressed in general with
a dedcated change.

Used command(s):

```bash
Build/Scripts/runTests.sh -t 12 -p 8.1 -s phpstanGenerateBaseline
```

Related: #395
Related: #398
Related: #397
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Frontend preview flag information not working in TYPO3 v12 anymore
1 participant