Skip to content
Snippets Groups Projects
Commit 1c4cfe04 authored by Christian Kuhn's avatar Christian Kuhn
Browse files

[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-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/77369


Reviewed-by: default avatarChristian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: default avatarBenni Mack <benni@typo3.org>
Tested-by: default avatarBenni Mack <benni@typo3.org>
Tested-by: default avatarChristian Kuhn <lolli@schwarzbu.ch>
Tested-by: default avatarStefan Bürk <stefan@buerk.tech>
Reviewed-by: default avatarStefan Bürk <stefan@buerk.tech>
Tested-by: default avatarcore-ci <typo3@b13.com>
parent 1e5b4d03
No related branches found
No related tags found
Loading
Showing
with 267 additions and 256 deletions
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment