Skip to main content

[TASK] Simplify IncludeTree identifier calculation

We need unique identifiers in both TypoScript
"AST" and "IncludeTree" to reference nodes in
the backend modules.

This has been established with #99537 for the
include tree already, while #99747 came with
a simplified approach for AST nodes.

The patch changes the include tree approach to
use the same simplified version as done with
AST nodes, which avoids some runtime overhead
in non-backend context.

As drive-by, the HTML of "Active PageTsConfig"
view is streamlined a bit.

Change-Id: I2d3855ef260ea23bc43aebb199dd04d12de3ac0f
Resolves: #99753
Related: #99537
Related: #99747
Tested-by: Christian Kuhn <>
Tested-by: Nikita Hovratov <>
Reviewed-by: Christian Kuhn <>
Reviewed-by: Stefan Bürk <>
Reviewed-by: Nikita Hovratov <>
Tested-by: core-ci <>
Tested-by: Stefan Bürk <>

[TASK] Streamline TypoScript IncludeTree logic

The patch comes with a couple of changes for
the TypoScript IncludeTree construct:

* Identifiers are now unique within a tree. This
is needed especially in the Backend
TypoScript -> Included Template files rendering:
Before, showing content of single segments did
not work due to duplicate identifiers.

* getIdentifier() is hardened to throw an
exception if not initialized: This detail is
only needed for non-cache analysis purposes and
identifiers don't exist when getting trees from cache
in Frontend.

* To allow file includes relative to a parent file
include, they now have a "path" property that is
properly hand over to child includes. Relative
child includes now work with include_static
sys_template includes as well.

* RootInclude now has an identifier as well to
seed child includes which include the parent
identifier in their hash.

* Identifier hashes and cache identifiers are built
with fast xxh3 hash in favor of sha1() and
json_encode() is used in favor of serialize()
when hashing structures, if possible.

* Identifier hashes are created in the setter
instead of calling hash() in the caller.

* [end] and [global] lines are now parts of the
previous condition segment and don't create
one-line segments anymore.

* Tests are adapted to be a bit less noisy on
properties we're not interested in by using
another custom comparator.

Change-Id: I9c03edfcf29e2887c0ef70ce1692582524333bdf
Resolves: #99537
Related: #97816
Releases: main
Reviewed-by: Christian Kuhn <>
Reviewed-by: Benni Mack <>
Tested-by: Benni Mack <>
Tested-by: Christian Kuhn <>
Tested-by: Stefan Bürk <>
Reviewed-by: Stefan Bürk <>
Tested-by: core-ci <>