Slug improvements for heavy localisation
If you have regional content the slug generation function needs to be improved slightly to prevent duplicate slugs.
Case 1: Currently language 'all' is not checked when a new Slug is generated. If you e.g. use News with language 'all' and normal translations in the same Folder you will have the problem that they can have the same 'path_segment' which shouldn't be the case since they will be shown at the same time. I added a Patch which fixes this issue.
Case 2: If you have regional content like e.g. a Folder 'Global News ' and then additional Folders like 'NA News ', 'EA News ', 'LA News ', then the slug generation options 'uniqueInSite' and 'uniqueInPid' are not enough anymore and you need an additional Option like 'uniqueInGroups' where you can configure groups of pid's which need unique URLs, since you may want the same URL in each of the regional Folders but not if you compare the global Folder and the regional Folder.
I attached a patch for 'typo3/sysext/core/Classes/DataHandling/SlugHelper.php', then you just have to add the new eval value to files like 'typo3/sysext/core/Classes/DataHandling/DataHandler.php' and adapt your TCA configuration of the 'path_segment' field to something like:
'path_segment' => [ 'config' => [ 'eval' => 'uniqueInGroups', 'generatorOptions' => [ 'pidGroups' => [ [14, 15], [14, 16], [14, 17], ] ] ] ]
Wenn generating a slug this function checks if your current pid is in a configured group and adds all pid's of that group to the QueryBuilder. If your current pid is in none of the groups the behavior is the same as 'uniqueInPid'.