Bug #52635

Incorrect merging of Views.yaml files from multiple Packages

Added by Marc Neuhaus almost 2 years ago. Updated almost 2 years ago.

Status:Resolved Start date:2013-10-09
Priority:Should have Due date:
Assigned To:Bastian Waidelich % Done:

100%

Category:-
Target version:-
PHP Version: Complexity:
Has patch:No Affected Flow version:Git master

Description

There is an issue with the way the Views.yaml files are merged in the ConfigurationManager because of the unnamed, indexed way the Views.yaml files are meant to be.

Example:

Given these two Views.yaml files form different packages:

Package1/Views.yaml

-
  requestFilter: 'isPackage("Package1.Features")'
  options:
    layoutRootPathPattern: resource://Famelo.ADU/Private/Layouts/
    templatePathAndFilename: resource://Famelo.ADU/Private/Templates/Features/Index.html

Package2/Views.yaml

-
  requestFilter: 'isPackage("TYPO3.Expose")'
  options:
    typoScriptPathPatterns:
      - 'resource://TYPO3.Expose/Private/TypoScripts/'
      - 'resource://Famelo.ADU/Private/TypoScripts/'
-
  requestFilter: 'isPackage("Package2.Foo")'
  options:
    layoutRootPathPattern: resource://Famelo.ADU/Private/Layouts/

will result in this merged configuration:

-
  requestFilter: 'isPackage("TYPO3.Expose")'
  options:
    typoScriptPathPatterns:
      - 'resource://TYPO3.Expose/Private/TypoScripts/'
      - 'resource://Famelo.ADU/Private/TypoScripts/'
    layoutRootPathPattern: resource://Famelo.ADU/Private/Layouts/
    templatePathAndFilename: resource://Famelo.ADU/Private/Templates/Features/Index.html
-
  requestFilter: 'isPackage("Package2.Foo")'
  options:
    layoutRootPathPattern: resource://Famelo.ADU/Private/Layouts/

Which in turn throw an exception, because it will try to set a templatePathAndFilename on a TypoScriptView which hasn't that option.

Possible Solution
We already discussed this briefly in IRC and agreed to create a new ConfigurationProcessingType which will append instead of merge
indexed arrays.

Associated revisions

Revision dbd2f265
Added by Bastian Waidelich almost 2 years ago

[BUGFIX] Append Views configurations instead of merging them

Configurations from Views.yaml are merged together leading to mixed
up configurations and invalid options.

This adds a new processing type CONFIGURATION_PROCESSING_TYPE_APPEND
that does not merge configurations from packages & contexts
recursively but appends them into a flat array.

Change-Id: I5cb86bd6085a4a2f1f529b1f32b4f3ca166b5b64
Releases: master
Fixes: #52635

History

#1 Updated by Gerrit Code Review almost 2 years ago

  • Status changed from New to Under Review

Patch set 1 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/24526

#2 Updated by Gerrit Code Review almost 2 years ago

Patch set 2 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/24526

#3 Updated by Bastian Waidelich almost 2 years ago

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

Also available in: Atom PDF