Bug #86821

Slug generator doesn't work for custom records anymore in 9.5.1

Added by Jacco van der Post almost 3 years ago. Updated over 2 years ago.

Status:
Closed
Priority:
Must have
Assignee:
-
Category:
-
Target version:
-
Start date:
2018-11-01
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
9
PHP Version:
7.2
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

I have in my domain model

        'slug' => [
            'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_tca.xlf:pages.slug',
            'exclude' => 1,
            'config' => [
                'type' => 'slug',
                'generatorOptions' => [
                    'fields' => ['subject'],
                    'fieldSeparator' => '/',
                    'prefixParentPageSlug' => false,
                ],
                'fallbackCharacter' => '-',
                'eval' => 'uniqueInSite',
            ],
        ],

When creating a record in 9.5.0 backend the slug field gets auto filled. Also the 'Recalculate URL segment from page title' refresh button does not work anymore to (re)generate the segment.

In 9.5.1 it does not work.

Another question (of topic sry) how can I generate a slug in a domain model of controller for example during a createAction?


Files

typo3_8aacc053fe.log (16.5 KB) typo3_8aacc053fe.log Exception stack trace for SlugHelper::buildSlugForUniqueInPid() Chris Müller, 2018-11-05 10:37

Related issues

Related to TYPO3 Core - Bug #86849: Slug generation in record fails since update to 9.5.1Rejected2018-11-05

Actions
Is duplicate of TYPO3 Core - Bug #86809: Resolve strict type assertion in RecordStateFactoryClosed2018-10-31

Actions
#1

Updated by Jacco van der Post almost 3 years ago

I meant of course the auto fill upon save and the refresh button does work in 9.5.0 but not in 9.5.1.

Also, maybe be a TCA option to leave away the domain name prepending the slug field, this does not make sense for plugin records.

Ah.. found out how to use the core slugHelper, by making an instance of it and then use the sanitize method :)

#2

Updated by Joerg Kummer almost 3 years ago

Jacco van der Post, same problem currently with slug field in EXT:news (path_segment), when using 9.5.1
There came a bugfix https://forge.typo3.org/issues/86809.
Could you try to load dev version (TYPO3 9.5.2-dev) and test, if its solve the issue for you, without your changes you described?

#3

Updated by Jacco van der Post almost 3 years ago

@Joerg, thank you. The bugfix resolves this problem.

#4

Updated by Georg Ringer almost 3 years ago

  • Status changed from New to Resolved

closing the issue because authors says its fixed.

#5

Updated by Georg Ringer almost 3 years ago

  • Is duplicate of Bug #86809: Resolve strict type assertion in RecordStateFactory added
#6

Updated by Joerg Kummer almost 3 years ago

  • Related to Bug #86849: Slug generation in record fails since update to 9.5.1 added
#7

Updated by Chris Müller almost 3 years ago

The problem with regenerating the slug is solved, but I cannot save the extension record, an exception is thrown:

Argument 2 passed to TYPO3\CMS\Core\DataHandling\SlugHelper::buildSlugForUniqueInPid() must be an instance of TYPO3\CMS\Core\DataHandling\Model\RecordState, instance of TYPO3\CMS\Core\DataHandling\Model\RecordStateFactory given, called in /var/www/html/public/typo3/sysext/core/Classes/DataHandling/DataHandler.php on line 2006

Full stack trace see attachment (typo3_8aacc053fe.log).

Please re-open the issue.

#8

Updated by Benni Mack over 2 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF