Project

General

Profile

Actions

Bug #101407

closed

ext_typoscript_setup.typoscript is only available in one Page Tree (Multiple Sites)

Added by Steffen Mächtel 9 months ago. Updated 9 months ago.

Status:
Resolved
Priority:
Should have
Assignee:
-
Category:
Frontend
Target version:
-
Start date:
2023-07-21
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
12
PHP Version:
8.2
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

Only affectes installation with Multiple Sites Configuration (2 or more). Issue is only in TYPO3 12. Tested with 12.4.1 - 12.4.3.

When caching is enabled (Production) and an extension have an ext_typoscript_setup.typoscript in extension root, the typoscript is only avalailable in one PageTree (One Site).

Example Code

EXT:my_extension/ext_typoscript_setup.typoscript

plugin.tx_myextension {
    view {
        templateRootPath >
        templateRootPaths {
            10 = EXT:my_extension/Resources/Private/SomeDifferentDirectory/Templates/
        }
    }
}

This should be available in every page tree.

Steps to reproduce: (see example_my_extension.zip attached)

1) New Clean TYPO3 12.4.3 installation (or 12.4.1, 12.4.2)

2) Have 2 Sites (PageTrees) in one Installation: example1.local and example2.local

3) Place the Plugin ("My Extension") on both Page Trees.

Test:

- Clear Cache
- Call Frontend www.example-1.com => typocript (Change of template path available)
- Call same Frontend again www.example-1.com => still working, all good
- Call Frontend www.example-2.com => Error, typoscript not available

Swap the test:

- Clear Cache
- Call Frontend www.example-2.com => typocript (Change of template path available)
- Call same Frontend again www.example-2.com => still working, all good
- Call Frontend www.example-1.com => Error, typoscript not available


Files

example_my_extension.zip (5.69 KB) example_my_extension.zip Small Example Plugin Extension to reproduce Steffen Mächtel, 2023-07-21 11:24
Multiple_Sites.png (27.5 KB) Multiple_Sites.png Backend with 2 Sites Steffen Mächtel, 2023-07-21 11:24
Page_Tree_1.png (9.76 KB) Page_Tree_1.png Result Page Tree 1 (after clear cache and reload) Steffen Mächtel, 2023-07-21 11:24
Page_Tree_2.png (12.9 KB) Page_Tree_2.png Result Page Tree 2 (opened after page tree 1) Steffen Mächtel, 2023-07-21 11:24
Blank_Line.png (51.6 KB) Blank_Line.png Steffen Mächtel, 2023-07-29 00:18
Works.png (49.4 KB) Works.png Steffen Mächtel, 2023-07-29 00:19

Related issues 3 (0 open3 closed)

Related to TYPO3 Core - Bug #101177: Broken TypoScript cache handling in multisiteResolved2023-06-27

Actions
Related to TYPO3 Core - Feature #97816: New TypoScript parserClosed2022-06-27

Actions
Related to TYPO3 Core - Bug #101656: Using Include TypoScript in template fails to apply included templateClosed2023-08-11

Actions
Actions #1

Updated by Steffen Mächtel 9 months ago

  • Subject changed from ext_typoscript_setup.typoscript is only avalaible in one Page Tree (MutliSite) to ext_typoscript_setup.typoscript is only available in one Page Tree (MutliSite)
Actions #2

Updated by Steffen Mächtel 9 months ago

  • Subject changed from ext_typoscript_setup.typoscript is only available in one Page Tree (MutliSite) to ext_typoscript_setup.typoscript is only available in one Page Tree (Multiple Sites)
Actions #3

Updated by Christian Kuhn 9 months ago

  • Related to Bug #101177: Broken TypoScript cache handling in multisite added
Actions #4

Updated by Christian Kuhn 9 months ago

Actions #5

Updated by Christian Kuhn 9 months ago

Hey.

First: Thanks for a good how-to-reproduce and a boiled down test extension! It took me just a couple of minutes to look at this and it would have taken much longer otherwise. Thanks!

However, I'm currently unable to reproduce (details below). We've had an important cache related fix with #101177 in this area, which has been released with 12.4.3, and is in 12.4.4 as well, of course. Is there any chance you mis-measured your 12.4.3 result?

Here is what I did:
  • new core dev-main (v13) installation, v12 is identical in this regard, I would be very baffled if v12<->main behaves differently here.
  • Create two top level pages "Example1" and "Example2", site records are created automatically
  • Create a sys_template record for both, both have (db wise) root=1, clear=3, include_static="EXT:fluid_styled_content/Configuration/TypoScript/" and config:
    " 
    # Default PAGE object:
    page = PAGE
    page.typeNum = 0
    page.10 < styles.content.get
    " 
    
  • Note the detail content of sys_template records are important, this influences caching: Same sys_template records can share things in cache - that's one of the new ts parser features. To be sure, here is my output on mariadb lowlevel (two "content identical" rows, just tstamp and crdate are different, which are not used in cache-identifier-hashes):
    MariaDB [coreinstall]> select * from sys_template;
    +-----+-----+------------+------------+---------+--------+-----------+---------+---------+-------------+------------+----------+------+-------+----------------------------------------------------+-----------+---------------------------------------------------------------------------------------+---------+---------------------------+------------------+-------------------+
    | uid | pid | tstamp     | crdate     | deleted | hidden | starttime | endtime | sorting | description | t3_origuid | title    | root | clear | include_static_file                                | constants | config                                                                                | basedOn | includeStaticAfterBasedOn | static_file_mode | tx_impexp_origuid |
    +-----+-----+------------+------------+---------+--------+-----------+---------+---------+-------------+------------+----------+------+-------+----------------------------------------------------+-----------+---------------------------------------------------------------------------------------+---------+---------------------------+------------------+-------------------+
    |   1 |   1 | 1690559581 | 1690558132 |       0 |      0 |         0 |       0 |     256 | NULL        |          0 | NEW SITE |    1 |     3 | EXT:fluid_styled_content/Configuration/TypoScript/ | NULL      | # Default PAGE object:
    page = PAGE
    page.typeNum = 0
    page.10 < styles.content.get
     |         |                         0 |                0 |                 0 |
    |   2 |   2 | 1690559588 | 1690558664 |       0 |      0 |         0 |       0 |     256 | NULL        |          0 | NEW SITE |    1 |     3 | EXT:fluid_styled_content/Configuration/TypoScript/ | NULL      | # Default PAGE object:
    page = PAGE
    page.typeNum = 0
    page.10 < styles.content.get
     |         |                         0 |                0 |                 0 |
    +-----+-----+------------+------------+---------+--------+-----------+---------+---------+-------------+------------+----------+------+-------+----------------------------------------------------+-----------+---------------------------------------------------------------------------------------+---------+---------------------------+------------------+-------------------+
    2 rows in set (0,000 sec)
    
    
  • Now create the two plugin content elements on the two root pages.
  • Start an "icognito" browser session to call the frontend (to not have a BE user logged in).
  • Call autogenerated-1: "Correct Template"
  • Call autogenerated-1 again: "Correct Template"
  • Call autogenerated-2: "Correct Template"
  • Call autogenerated-2 again: "Correct Template"

From reading the code, I think 12.4.3 fixed the "different site" related cache issue already. Could you please re-check and tell me what I may be missing on my side to reproduce the issue in case you are still able to reproduce this?

I think it's fine, but of course we still may have missed something. It would be great if you could have just another look at this to verify if this is still an issue after the 12.4.3 fix in this area. Please point me into the right direction if this is the case.

Actions #6

Updated by Christian Kuhn 9 months ago

  • Status changed from New to Needs Feedback

Updated by Steffen Mächtel 9 months ago

Hey,

i tested it again with a fresh 12.4.4 installation.

I found something:

UPDATE: The error occurs if TypoScript is not 100% identical in page tree 1 and 2. Add a blank line for example in one Page Tree TypoScript Setup and dont add the Blank line in the other.

The Error only occurs if i have a blank line in TypoScript Setup in the end. Without blank line in the end, everything works as expected. With blank line in the end, it always fails in one page tree.

@see Screenshot appended "Blank_Line.png" => Error occurs in one page tree

@see Screenshot appended "Works .png" => Both page tree work with correct template path

I repeated this test multiple times now:

Test with identical TypoScript:

- Clear Cache
- Call autogenerated-1: "Correct Template"
- Call autogenerated-1 again: "Correct Template"
- Call autogenerated-2: "Correct Template"
- Call autogenerated-2 again: "Correct Template"

Test with one TypoScript added a blank line:

- Clear Cache
- Call autogenerated-1: "Correct Template"
- Call autogenerated-1 again: "Correct Template"
- Call autogenerated-2: "WRONG Template"
- Call autogenerated-2 again: "WRONG Template"

Swap Test:

- Clear Cache
- Call autogenerated-2: "Correct Template"
- Call autogenerated-2 again: "Correct Template"
- Call autogenerated-1: "WRONG Template"
- Call autogenerated-1 again: "WRONG Template"

Actions #8

Updated by Christian Kuhn 9 months ago

Confirmed. Thanks for looking at this some further!

Found issue. Patch incoming.

Actions #9

Updated by Gerrit Code Review 9 months ago

  • Status changed from Needs Feedback to Under Review

Patch set 1 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/80240

Actions #10

Updated by Gerrit Code Review 9 months ago

Patch set 2 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/80240

Actions #11

Updated by Gerrit Code Review 9 months ago

Patch set 1 for branch 12.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/80220

Actions #12

Updated by Christian Kuhn 9 months ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #13

Updated by Jasmina Ließmann 9 months ago

  • Related to Bug #101656: Using Include TypoScript in template fails to apply included template added
Actions

Also available in: Atom PDF