Skip to content

Commit

Permalink
[BUGFIX] Use static prefix as documented
Browse files Browse the repository at this point in the history
The documentation says:

    TCEMAIN.pages.slug.generatorOptions {
        prefix = /wishlist/
    }

but the code worked like this:

    TCEMAIN.pages.slug {
        prefix = /wishlist/
    }

The bugfix makes it consistent in the
"generatorOptions" namespace, as this
option is fully related for the
generation of a URL. This way,
the documentation does not need adaption.

THE CORRECT WAY NOW IS THIS:

    TCEMAIN.pages.slug.generatorOptions {
        prefix = /wishlist/
    }
  • Loading branch information
bmack committed Jul 3, 2019
1 parent 478c360 commit 2021610
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Classes/SlugModifier.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ protected function resolveHookParameters(array $configuration, $tableName, $fiel
*/
protected function regenerateSlug(SlugHelper $helper): string
{
$prefix = $this->configuration['prefix'] ?? '';
$prefix = $this->configuration['generatorOptions']['prefix'] ?? '';
if ($this->configuration['generatorOptions']['prefixParentPageSlug'] ?? false) {
$languageFieldName = $GLOBALS['TCA'][$this->tableName]['ctrl']['languageField'] ?? null;
$languageId = (int)($this->recordData[$languageFieldName] ?? 0);
Expand Down

0 comments on commit 2021610

Please sign in to comment.