1. 07 May, 2022 4 commits
  2. 06 May, 2022 5 commits
  3. 05 May, 2022 1 commit
  4. 04 May, 2022 1 commit
  5. 03 May, 2022 2 commits
  6. 02 May, 2022 1 commit
  7. 29 Apr, 2022 1 commit
  8. 28 Apr, 2022 2 commits
    • Georg Ringer's avatar
      [TASK] Remove broken include_static.txt TypoScript include · fe3e5897
      Georg Ringer authored and Benjamin Franzke's avatar Benjamin Franzke committed
      The inclusion of 'include_static.txt' files within the
      TypoScript inclusion magic has been part of the extension
      'statictemplates' back in the old days: It brought a database
      field 'include_static' together with a hook in TemplateService
      that took care of that field content. It then indirectly also
      handled these 'include_static.txt' file inclusions.
      
      Extension 'statictemplates' has been removed from core with
      TYPO3 6.2. Since then, 'include_static.txt' files had no
      effect anymore.
      
      The patch removes the dead code artifact from TemplateService
      and adapts some documentation accordingly.
      
      Resolves: #97501
      Related: #46469
      Releases: main
      Change-Id: I07bb118bc405c97da6810eca0061ab6968564fc7
      Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/74434
      
      
      Reviewed-by: Stephan Großberndt's avatarStephan Großberndt <stephan.grossberndt@typo3.org>
      Reviewed-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
      Reviewed-by: Benjamin Franzke's avatarBenjamin Franzke <bfr@qbus.de>
      Tested-by: core-ci's avatarcore-ci <typo3@b13.com>
      Tested-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
      Tested-by: Benjamin Franzke's avatarBenjamin Franzke <bfr@qbus.de>
      fe3e5897
    • Stefan Bürk's avatar
      [BUGFIX] Adopt doctrine/dbal sqlite autoincrement detection · 3e5c0604
      Stefan Bürk authored and Anja Leichsenring's avatar Anja Leichsenring committed
      sqlite basicly knows about two kind of autoincrement column
      definition. One which is an alias on the provided "row_id"
      field for an integer field which is also the single field
      of the primary key index. And the second one with a real
      autoincrement notation, which is not an alias like the first
      one. Basicly this differes in some behaviours, mainly that
      the second one will never reassign ids which has been deleted.
      The first one will eventually reassign deleted ids to fill up
      spaces in between.
      
      This counts for inserts where the column data has a null value.
      If a real value is provided, this will be used.
      
      "ext:indexed_search" defines some tables with integer columns
      which are the primary key, which are not flagged as autoincrement
      fields. This is not needed as the inserted data always uses pre
      calculated hash values.
      
      This works pretty fine on most dbms. sqlite automatically assumes
      the autoincrement field (row_id) alias type for creation, which
      works so far pretty well.
      
      doctrine/dbal uses 'PRAGMA table_info(<table-name>)' to read
      the table structure, which do not containts the information
      if the field is created with the AUTOINCREMENT keyword or not.
      Reading the table struncture from a sqlite database sets the
      "autoincrement: true" value for colums of type integer, if
      they are the only included column of an primary key.
      
      On the other side, reading/building the meta schema based on
      the TYPO3 "ext_tables.sql" files of extensions and using the
      default table definition building based on TCA, the column
      will get "autoincrement: false" if the auto_increment keyword
      is not used.
      
      This will popup these tables again and again, as it always will
      detect the column as changed, because of the not matching column
      autoincrement value.
      
      This patch adopts this assumptions from doctrine/dbal and set the
      autoincrement to true, if a table has one primary key colum of
      type integer without a autoincremet flag. This will create the
      real autoincrement column instead, which is a safer variant for it.
      
      doctrine/dbal added this detection based on these assumptions with:
      https://github.com/doctrine/dbal/commit/33555d36e7e7d07a5880e01
      
      Resolves: #97447
      Releases: main, 11.5
      Change-Id: I410da0db7a8f0748e5a8ee099cd36ee121cafa60
      Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/74362
      
      
      Tested-by: core-ci's avatarcore-ci <typo3@b13.com>
      Tested-by: Benni Mack's avatarBenni Mack <benni@typo3.org>
      Tested-by: Anja Leichsenring's avatarAnja Leichsenring <aleichsenring@ab-softlab.de>
      Reviewed-by: Oliver Klee's avatarOliver Klee <typo3-coding@oliverklee.de>
      Reviewed-by: Benni Mack's avatarBenni Mack <benni@typo3.org>
      Reviewed-by: Anja Leichsenring's avatarAnja Leichsenring <aleichsenring@ab-softlab.de>
      3e5c0604
  9. 27 Apr, 2022 2 commits
  10. 26 Apr, 2022 1 commit
  11. 25 Apr, 2022 2 commits
  12. 22 Apr, 2022 3 commits
    • crell's avatar
      [TASK] Switch specific strpos() usages with equivalent string methods · 7fb01f1e
      crell authored and Georg Ringer's avatar Georg Ringer committed
      Due to a former lack of missing proper functions to
      check for strings starting, ending or containing
      sub-strings, workarounds with strpos() constructs
      have been used in TYPO3 as well as in just about
      every PHP application.
      
      PHP finally implemented proper native functions for
      these kind of tasks, which make code more readable
      and avoid to easily oversee bugs.
      
      Additionally, php-cs-fixer provides a rule-set to replace
      most of these changes, see:
      https://cs.symfony.com/doc/ruleSets/PHP80MigrationRisky.html
      
      This rule is now enabled and used to ensure cleaner code
      in the future. The rule is applied to ensure green cgl checks.
      
      Replacements covered by php-cs-fixer rule:
      
      * replace `strpos($haystack, $needle) === 0`
        with `str_starts_with($haystack, $needle)`
      * replace `strpos($haystack, $needle) !== 0`
        with `!str_starts_with($haystack, $needle)`
      * replace `strpos($haystack, $needle) !== false`
        with `str_contains($haystack, $needle)`
      * replace `strpos($haystack, $needle) === false`
        with `!str_contains($haystack, $needle)`
      
      Some additional (manual) replacements on nearby places to
      changed code places:
      
      * replace `substr($haystack, strlen($needle) * -1) === $needle`
        with `str_ends_with($expression, ']')`
      * replace `substr($haystack, strlen($needle) * -1) !== $needle`
        with `!str_ends_with($expression, ']')`
      
      Used commands:
      
      > Build/Scripts/runTests.sh -s cgl
      
      Resolves: #97438
      Releases: main
      Change-Id: Ia1206d4dd08b43597bfe794389f6db8bdeb3de0f
      Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/74365
      
      
      Tested-by: core-ci's avatarcore-ci <typo3@b13.com>
      Tested-by: Nikita Hovratov's avatarNikita Hovratov <nikita.h@live.de>
      Tested-by: Stefan Bürk's avatarStefan Bürk <stefan@buerk.tech>
      Tested-by: Georg Ringer's avatarGeorg Ringer <georg.ringer@gmail.com>
      Reviewed-by: Nikita Hovratov's avatarNikita Hovratov <nikita.h@live.de>
      Reviewed-by: crell's avatarcrell <larry@garfieldtech.com>
      Reviewed-by: Stefan Bürk's avatarStefan Bürk <stefan@buerk.tech>
      Reviewed-by: Georg Ringer's avatarGeorg Ringer <georg.ringer@gmail.com>
      7fb01f1e
    • Benni Mack's avatar
      [!!!][FEATURE] Introduce dedicated class to create typolinks with unified Event · 4f7c4d1c
      Benni Mack authored and Oliver Bartsch's avatar Oliver Bartsch committed
      This change moves all "typolink" functionality
      from cObj->typolink into a custom "LinkFactory"
      class which then calls custom LinkBuilders (as before)
      to do their work.
      
      The main benefit is separation of concerns, thinning
      out functionality from the monster ContentObjectRenderer
      functionality.
      
      Instead of the global hook
      $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_content.php']['typoLink_PostProc']
      a new PSR-14 Event "AfterLinkIsGeneratedEvent" is introduced,
      which in turn uses the LinkResult to operate on.
      
      This new Event also makes the hook
      $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['urlProcessing']['urlProcessors']
      obsolete, which was used for non-page links + URLs. As
      all functionality for frontend links are now running
      through this event, which contains all information.
      
      In addition, typolink.userFunc now receives
      a LinkResult object instead of a <a> string with arguments,
      and needs to return a LinkResult object again.
      
      Also, the ATagParams hook vanished as well, since the
      new Event can be used easily (and in a much better way!)
      
      Both parts are breaking, all other parts are expected
      to work as before.
      
      A new HtmlLinkResult is added, which allows for building
      a HSC'ed <a> tag properly in typolink().
      
      Architectural Details:
      
      * LinkFactory (new class) is now handling the "typolink" logic
        for creating any kind of links or URLs (page/mails/files).
        For the actual logic of e.g, pages the "PageLinkBuilder" is used
        in this place.
      * Internally, LinkFactory follows the same generation as
        cObj->typolink() before, but uses methods to make the code
        more readable.
      * In the end, LinkFactory will return a "LinkResultInterface"
        which contains everything to build a <a> tag, however it
        cannot return a "UriInterface" from PSR-7, as a
        link to mailto: is not a URL, thus, not supported by PSR-7.
      * The main "cObj->typolink()" method then takes the LinkResultInterface
        and wraps it into a HtmlLinkResult which does a htmlspecialchars()
        around all the attributes and the $linkText. So this is still
        the way to go to use from a public API point of view.
      * As typolink() heavily depends on stdWrap() and thus on cObject
        this information needs to be injected properly of course, and
        has the hard dependency when creating links in the Frontend.
      * new methods $cObj->createUrl() and $cObj->createLink() are added
        to make use of the LinkInterface functionality programmatically,
        so people can choose to get a hsc'ed result via typolink(),
        or typolink_URL(), or a pure data via createUrl() and createLink().
      
      Next steps / further patches:
      * Deprecate "lastTypoLink_LD" etc.
      * Move LinkResultFactory into LinkFactory with ClassAlias
      * Maybe add another method to just generate an URL to the LinkFactory
      * Create JsonLinkResult object and clean up original LinkResult object
      
      Resolves: #96641
      Resolves: #92029
      Releases: main
      Change-Id: Ic9ce01153a0cfdcbacb15e1e3f3e382f95400192
      Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/72999
      
      
      Tested-by: core-ci's avatarcore-ci <typo3@b13.com>
      Tested-by: Oliver Hader's avatarOliver Hader <oliver.hader@typo3.org>
      Tested-by: Stefan Bürk's avatarStefan Bürk <stefan@buerk.tech>
      Tested-by: Oliver Bartsch's avatarOliver Bartsch <bo@cedev.de>
      Reviewed-by: Oliver Hader's avatarOliver Hader <oliver.hader@typo3.org>
      Reviewed-by: Stefan Bürk's avatarStefan Bürk <stefan@buerk.tech>
      Reviewed-by: Oliver Bartsch's avatarOliver Bartsch <bo@cedev.de>
      4f7c4d1c
    • crell's avatar
      [!!!][TASK] Add native types to PathUtility · c2fe6511
      crell authored and Georg Ringer's avatar Georg Ringer committed
      I also changed the default value for pathinfo()'s $options
      argument to match that of PHP's pathinfo(), as that eliminated
      a null and simplified the code.
      
      Resolves: #97378
      Related: #97210
      Related: #97372
      Releases: main
      Change-Id: I4c608c5771a122f32952a67cecca7ef1f5229c48
      Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/74312
      
      
      Tested-by: core-ci's avatarcore-ci <typo3@b13.com>
      Tested-by: Simon Schaufelberger's avatarSimon Schaufelberger <simonschaufi+typo3@gmail.com>
      Tested-by: Georg Ringer's avatarGeorg Ringer <georg.ringer@gmail.com>
      Reviewed-by: default avatarJörg Bösche <typo3@joergboesche.de>
      Reviewed-by: Oliver Klee's avatarOliver Klee <typo3-coding@oliverklee.de>
      Reviewed-by: Simon Schaufelberger's avatarSimon Schaufelberger <simonschaufi+typo3@gmail.com>
      Reviewed-by: Georg Ringer's avatarGeorg Ringer <georg.ringer@gmail.com>
      c2fe6511
  13. 21 Apr, 2022 2 commits
  14. 20 Apr, 2022 1 commit
  15. 19 Apr, 2022 2 commits
  16. 18 Apr, 2022 2 commits
  17. 17 Apr, 2022 2 commits
  18. 16 Apr, 2022 1 commit
  19. 14 Apr, 2022 3 commits
  20. 13 Apr, 2022 1 commit
  21. 12 Apr, 2022 1 commit