Skip to content
Snippets Groups Projects
  1. Apr 12, 2024
  2. Apr 09, 2024
  3. Apr 07, 2024
    • Christian Kuhn's avatar
      [BUGFIX] Mitigate misusing request 'id' as pages-uid in extbase BE · 524267cd
      Christian Kuhn authored
      The backend uses request GET/POST parameter 'id' as convention for
      "pages uid" at various places: Especially the BackendModuleValidator
      checks for this parameter early, to deny access to pages a BE user
      has no access to.
      
      This convention is a broken misuse: There is no such convention,
      and for instance the filelist module uses 'id' to transfer a
      selected "storage-uid:path".
      
      The BackendModuleValidator mitigates this by calling
      MU::canBeInterpretedAsInteger() before interpreting that
      parameter as a pages-uid.
      
      The extbase BackendConfigurationManager also uses 'id' to retrieve
      the FE TypoScript configuration for this "pages-uid", it however
      does not check with MU::canBeInterpretedAsInteger(), first.
      
      The patch adds a MU::canBeInterpretedAsInteger() check to extbase
      BackendConfigurationManager to be in-line with BackendModuleValidator,
      and adds `@todo` comments outlining the general misuse of the argument.
      
      Change-Id: I9b53a521bde4d3c145bfda2994d81dc4abf9c103
      Resolves: #103540
      Related: #96797
      Releases: main, 12.4
      Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/83678
      
      
      Reviewed-by: default avatarChristian Kuhn <lolli@schwarzbu.ch>
      Tested-by: default avatarcore-ci <typo3@b13.com>
      Tested-by: default avatarChristian Kuhn <lolli@schwarzbu.ch>
      524267cd
  4. Apr 04, 2024
  5. Mar 19, 2024
  6. Mar 12, 2024
  7. Mar 06, 2024
  8. Feb 26, 2024
    • Christian Kuhn's avatar
      [TASK] Use phpunit attributes in functional tests · 55820a0d
      Christian Kuhn authored
      phpunit 11 deprecates annotations like `@test` and
      `@dataProvider` in favor of their attribute counterparts.
      
      We'll adapt core main & v12 to keep v12 backports
      simple. The patch takes care of Tests/Functional and
      Tests/FunctionalDeprecated.
      
      Script `Build/Scripts/splitFunctionalTests.php` is
      adapted to deal with annotations for CI to continue
      splitting functional tests into chunks. This also
      fixes detection in two test cases that had unexpected
      `@test` annotation combinations which were not properly
      detected before.
      
      > composer req --dev rector/rector
      > wget https://forge.typo3.org/attachments/download/38273/rector.php
      > find typo3/ -name \*Test.php | grep Tests/Functional | xargs bin/rector process
      > rm rector.php
      > composer rem --dev rector/rector
      
      Minor manual adaption in a few files plus cgl fixes.
      
      Also deny `@test` annotion in annotationChecker.php now
      to not introduce new occurences with other patches anymore.
      The script will receive another cleanup to look at further
      obsolete annotations. `@dataProvider` is currently still
      used in acceptance tests.
      
      Change-Id: I42705b57193a32db6fe17276d53476ecddcae835
      Resolves: #103195
      Related: #103180
      Releases: main, 12.4
      Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/83129
      
      
      Tested-by: default avatarChristian Kuhn <lolli@schwarzbu.ch>
      Tested-by: default avatarcore-ci <typo3@b13.com>
      Reviewed-by: default avatarChristian Kuhn <lolli@schwarzbu.ch>
      55820a0d
  9. Feb 23, 2024
  10. Feb 21, 2024
  11. Feb 20, 2024
  12. Feb 13, 2024
  13. Feb 07, 2024
  14. Feb 02, 2024
  15. Jan 28, 2024
  16. Jan 23, 2024
  17. Jan 22, 2024
  18. Jan 16, 2024
  19. Jan 12, 2024
  20. Jan 04, 2024
    • Benni Mack's avatar
      [TASK] Streamline indentation of arrays and comments · 8cdf6380
      Benni Mack authored
      PHP-CS-Fixer rule `array_indentation` is activated to have
      consistent indentation of arrays.
      
      In addition, a full run of php-cs-fixer without
      caches shows also affected areas where comments
      did not apply properly.
      
      Resolves: #102753
      Releases: main, 12.4, 11.5
      Change-Id: I759149606c4b042f1ac4329d4f5b7166d591456b
      Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/82334
      
      
      Tested-by: default avatarcore-ci <typo3@b13.com>
      Reviewed-by: default avatarBenni Mack <benni@typo3.org>
      Tested-by: default avatarBenni Mack <benni@typo3.org>
      8cdf6380
    • Benni Mack's avatar
      [TASK] Allow usage of symfony 7 · b03970d9
      Benni Mack authored
      This change enables Symfony 7 in
      addition to symfony 6 in TYPO3.
      
      Symfony7 requires PHP 8.2, thus
      is not installed by default for the
      time being, as this change is also
      allowed for TYPO3 v12 support when
      running with PHP 8.2 and composer.
      
      Used commands:
      
      composer req -W \
       "symfony/config:^6.4 || ^7.0" \
       "symfony/console:^6.4 || ^7.0" \
       "symfony/dependency-injection:^6.4 || ^7.0" \
       "symfony/doctrine-messenger:^6.4 || ^7.0" \
       "symfony/expression-language:^6.4 || ^7.0" \
       "symfony/filesystem:^6.4 || ^7.0" \
       "symfony/finder:^6.4 || ^7.0" \
       "symfony/http-foundation:^6.4 || ^7.0" \
       "symfony/mailer:^6.4 || ^7.0" \
       "symfony/messenger:^6.4 || ^7.0" \
       "symfony/mime:^6.4 || ^7.0" \
       "symfony/options-resolver:^6.4 || ^7.0" \
       "symfony/property-access:^6.4 || ^7.0" \
       "symfony/property-info:^6.4 || ^7.0" \
       "symfony/rate-limiter:^6.4 || ^7.0" \
       "symfony/routing:^6.4 || ^7.0" \
       "symfony/uid:^6.4 || ^7.0" \
       "symfony/var-dumper:^6.4 || ^7.0" \
       "symfony/yaml:^6.4 || ^7.0"
      
       composer req --dev -W \
       "codeception/codeception:^5.0.13" \
       "codeception/module-filesystem:^3.0.1" \
       "friendsofphp/php-cs-fixer:^3.46" \
       "symfony/translation:^6.4 || ^7.0"
      
      Resolves: #102746
      Releases: main, 12.4
      Change-Id: I6bbbfb0bc6e26c00fba0010234b5c8b698cf0a81
      Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/82314
      
      
      Tested-by: default avatarcore-ci <typo3@b13.com>
      Tested-by: default avatarBenni Mack <benni@typo3.org>
      Reviewed-by: default avatarBenni Mack <benni@typo3.org>
      b03970d9
  21. Dec 13, 2023
    • Nikita Hovratov's avatar
      [TASK] Extract registration of controller actions into separate method · e4105ace
      Nikita Hovratov authored
      EU::configurePlugin tightly couples registration of controller actions
      and TypoScript generation for a frontend rendering definition.
      Furthermore, lib.contentElement is only defined in fluid_styled_content,
      which makes it an indirect requirement.
      
      This patch extracts the part for the controller action registration, so
      it can be used independently of fluid_styled_content. In addition, this
      new method expects the controller actions to have an array shape
      already. A converter method ensures compatibility for both string and
      array syntax.
      
      A concrete use-case for internal usage would be Content Blocks, as it
      would be possible to separately define a Content Block of type "Plugin"
      and in addition register controller actions for it.
      
      Resolves: #102643
      Releases: main, 12.4
      Change-Id: I74d84f54bdd399934b57b3e49e2209f62b5fda68
      Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/82181
      
      
      Reviewed-by: default avatarOliver Bartsch <bo@cedev.de>
      Tested-by: default avatarOliver Bartsch <bo@cedev.de>
      Tested-by: default avatarcore-ci <typo3@b13.com>
      e4105ace
  22. Dec 12, 2023
  23. Dec 08, 2023
  24. Dec 06, 2023
  25. Dec 05, 2023
    • Benni Mack's avatar
      [BUGFIX] Include records in Extbase without a l10n parent · 9ab43f07
      Benni Mack authored
      Within TYPO3's LanguageAspect there are four options for doing
      overlays:
      OVERLAYS_OFF -> fetch records in a specific language directly
      OVERLAYS_MIXED -> fetch default records + do overlays if available
      OVERLAYS_ON -> fetch default records + do overlays - discard if no overlay is available
      OVERLAYS_ON_WITH_FLOATING -> same as OVERLAYS_ON PLUS the records that have no l10n_parent.
      
      This change enables Extbase records to also be
      fetched when using LanguageAspect::OVERLAYS_ON_WIITH_FLOATING
      as floating records are the ones that do not have
      a l10n_parent set ("copy mode").
      
      Resolves: #87160
      Releases: main, 12.4
      Change-Id: I021efe3761efa63860eac5522af82fc20f0fe53f
      Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/82024
      
      
      Tested-by: default avatarcore-ci <typo3@b13.com>
      Tested-by: default avatarBenni Mack <benni@typo3.org>
      Reviewed-by: default avatarBenni Mack <benni@typo3.org>
      9ab43f07
    • Christian Kuhn's avatar
      [BUGFIX] Allow access to TypoScript overrides for labels in _LOCAL_LANG · 490f1269
      Christian Kuhn authored
      This bugfix enables the possibility to access _LOCAL_LANG
      values from TypoScript properly again via Extbase's
      LocalizationUtility, and thus for <f:translate> ViewHelpers
      as well again.
      
      This is what has changed under-the-hood:
      
      The TranslateViewHelper is now only a thin layer
      to Extbase's LocalizationUtility (as before), and only
      checks if a current request or Locale/languageKey is
      given, if a locale can be resolved. Everything else
      is then dispatched to the LocalizationUtility.
      
      <f:translate> is very clean now and has almost no further
      responsibility than to call LocalizationUtility::translate
      
      Instead of adding further LocalizationUtility magic,
      overriding of TypoScript is now enabled for any kind
      of plugin which hands in $extensionName. This is achieved
      by building proper Locale objects from the request which
      are then used to build the respective LanguageService.
      
      As it turned out after the 12.4.0 release, the "Locales"
      class is indeed the factory for creating a Locale, which
      is decoupled from the actual LanguageService (= label magic),
      the Locales factory receives a few create methods to make
      life easier for usage, which both f:translate AND
      LocalizationUtility receive, making their parts much smaller.
      
      Further work will dissolve the usage of the Configuration
      Manager of Extbase, but this won't happen in v12 anymore.
      
      Resolves: #100759
      Releases: main, 12.4
      Change-Id: Ifcad2ec590746e96066a96f314500bd50e9b4695
      Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/82023
      
      
      Tested-by: default avatarcore-ci <typo3@b13.com>
      Reviewed-by: default avatarBenni Mack <benni@typo3.org>
      Tested-by: default avatarBenni Mack <benni@typo3.org>
      490f1269
  26. Dec 04, 2023
    • Benni Mack's avatar
      [BUGFIX] Use locale dependencies in Extbase LocalizationUtility · 5ebad2d4
      Benni Mack authored
      Since TYPO3 v12.4, TYPO3 uses locales such as "de_DE"
      or "de-AT" in Site Configuration natively.
      
      In order to resolve the "locale dependencies" natively,
      a new Locale object needs to be created be the "Locales"
      factory class. This is needed to check for "de_AT.locallang.xlf"
      and falling back to "de.locallang.xlf" in a multi-step mode.
      
      This change adapts one place in Extbase's LocalizationUtility
      where a new Locale object was previously instantiated via
      new Locale() instead of using the "Locales" class which
      deals with all dependencies (incl. manually defined dependencies)
      directly there.
      
      A new comment is added to explain this inside the constructor
      of Locale.
      
      In addition, some more tests are added (including the ones
      that did not work before), as well as an example that
      it does not matter if the file is called "de-AT.locallang.xlf"
      (with a hyphen) or "de_CH.locallang.xlf" (with an underscore)
      
      Resolves: #102579
      Related: #101710
      Releases: main, 12.4
      Change-Id: Id51082e75cf635bbe3cbdfc906dc2a7442ab06af
      Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/82019
      
      
      Tested-by: default avatarcore-ci <typo3@b13.com>
      Reviewed-by: default avatarBenni Mack <benni@typo3.org>
      Tested-by: default avatarBenni Mack <benni@typo3.org>
      5ebad2d4
  27. Nov 30, 2023
    • Benni Mack's avatar
      [BUGFIX] Use config.sendCacheHeaders only for cacheable content · 637f1eab
      Benni Mack authored
      This changes the behaviour of config.sendCacheHeaders = 1.
      
      When a non-cacheable option is used, the HTTP Response
      Headers for ensuring that a response should never
      be cached (that is Cache-Control: private, no-store)
      should be sent at any time, as it could contain
      sensitive information, regardless of the TypoScript option.
      
      The TypoScript option config.sendCacheHeaders is
      then only used to actually explicitly send the headers
      for a fully client-cacheable page (e.g. for a proxy), to
      explicitly allow the cached content to be stored
      for a defined amount of time.
      
      In addition, a lot of tests have been adapted to
      remove this option as it does not have any effect
      in the tests if the option is set.
      
      Resolves: #102445
      Releases: main, 12.4
      Change-Id: I603e73a114eb9668910484da7e9dc4e0e33e56ba
      Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/82016
      
      
      Tested-by: default avatarcore-ci <typo3@b13.com>
      Reviewed-by: default avatarBenni Mack <benni@typo3.org>
      Tested-by: default avatarBenni Mack <benni@typo3.org>
      637f1eab
  28. Nov 29, 2023
  29. Nov 25, 2023
    • madaxel's avatar
      [BUGFIX] Avoid calling method on unavailable `frontend.typoscript` · 61873701
      madaxel authored
      The request attribute 'frontend.typoscript' might not be initialized
      at the point of calling `$request->getAttribute` and will return null.
      
      Even if this indicates that something is trying to access extbase to
      early in the stack without taking care to bootstrap it properly, the
      core should avoid a fatal error at that point.
      
      Therefore, a access guard is added in the `getTypoScriptSetup` method
      of the `FrontendConfigurationManager` to mitigate the fatal php error.
      The added guard does not fix the invalid state at that point as this
      is impossible, so extensions messing around in that early state may
      now not fatal but left with an invalid and incomplete state anyway.
      
      Note: This will replaced with a dedicated meaningfull exception in v13
            only in followup.
      
      Resolves: #102457
      Releases: main, 12.4
      Change-Id: I00ec0e95d3f5b92abf9ee5dabcf24369b5d6374b
      Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/81962
      
      
      Reviewed-by: default avatarStefan Bürk <stefan@buerk.tech>
      Tested-by: default avatarcore-ci <typo3@b13.com>
      Tested-by: default avatarStefan Bürk <stefan@buerk.tech>
      61873701
  30. Nov 23, 2023