[BUGFIX] Correctly evaluate "unique" eval for slug fields
TYPO3 v9.5.16, fixed functionality for URL resolving for records with slug fields defined as "uniqueInSite". With such setting, it is important to limit URL resolving to the site the slugs are generated for. Because we currently don't support records to be stored within one site, but generating slugs for another one, this change enforced the storage of news records to be in the same site as the detail page. This however led to not working installations, where a record storage folder is available in a site where other sites are fetching this information from, which is a quite common use case. To cover such use case, TCA needs to be adapted to the existing configuration eval=unique, which diables the site check in URL frontend resolving. However the current implementation of DataHandler only checks uniqueness of fields of type "input". This means for slug fields, the functionality of 'unique' is currently not taken into account when generating the slug, which can lead to duplicate slugs. To fix this problem, a check for the unique eval setting is added to DataHandler and FormSlugAjaxController. SlugHelper is adapted to correctly generate slugs for this use case. Resolves: #91235 Releases: master, 9.5 Change-Id: Id6e5c1d27860b09604787132f2cd83976418baa4 Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/64428 Tested-by:TYPO3com <noreply@typo3.com> Tested-by:
Benni Mack <benni@typo3.org> Tested-by:
Helmut Hummel <typo3@helhum.io> Reviewed-by:
Benni Mack <benni@typo3.org> Reviewed-by:
Henrik Ziegenhain <henrik@ziegenhain.me> Reviewed-by:
Helmut Hummel <typo3@helhum.io>
Showing
- typo3/sysext/backend/Classes/Controller/FormSlugAjaxController.php 5 additions, 0 deletions...ext/backend/Classes/Controller/FormSlugAjaxController.php
- typo3/sysext/core/Classes/DataHandling/DataHandler.php 3 additions, 0 deletionstypo3/sysext/core/Classes/DataHandling/DataHandler.php
- typo3/sysext/core/Classes/DataHandling/SlugHelper.php 52 additions, 0 deletionstypo3/sysext/core/Classes/DataHandling/SlugHelper.php
- typo3/sysext/core/Tests/Functional/DataHandling/DataHandler/DataSet/TestSlugUniqueBase.csv 5 additions, 0 deletions...l/DataHandling/DataHandler/DataSet/TestSlugUniqueBase.csv
- typo3/sysext/core/Tests/Functional/DataHandling/DataHandler/DataSet/TestSlugUniqueResult.csv 5 additions, 0 deletions...DataHandling/DataHandler/DataSet/TestSlugUniqueResult.csv
- typo3/sysext/core/Tests/Functional/DataHandling/DataHandler/SlugUniqueTest.php 74 additions, 0 deletions...ts/Functional/DataHandling/DataHandler/SlugUniqueTest.php
Please register or sign in to comment