wazum / sluggi

The TYPO3 CMS slug helper

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

getPrefix() has been removed in v10

valentin- opened this issue · comments

Hi, looks like the getPrefix-method inside the permission check has been removed in Typo3 v10 in \TYPO3\CMS\Backend\Form\Element\InputSlugElement.

https://github.com/wazum/sluggi/blob/master/Classes/Backend/Form/InputSlugElement.php#L50

It's working for me to simple insert the code snippet from v9 in Wazum\Sluggi\Backend\Form\InputSlugElement

     * Render the prefix for the input field.
     *
     * @param SiteInterface $site
     * @param int $requestLanguageId
     * @return string
     */
    protected function getPrefix(SiteInterface $site, int $requestLanguageId = 0): string
    {
        $language = ($requestLanguageId < 0) ? $site->getDefaultLanguage() : $site->getLanguageById($requestLanguageId);
        $base = $language->getBase();
        $baseUrl = (string)$base;
        $baseUrl = rtrim($baseUrl, '/');
        if (!empty($baseUrl) && empty($base->getScheme()) && $base->getHost() !== '') {
            $baseUrl = 'http:' . $baseUrl;
        }
        return $baseUrl;
    }

@valentin- thanks for your report, sluggi is not (yet) ready for version 10 #26

@valentin- Hey, check out the completely rewritten version for 10: https://github.com/wazum/sluggi/tree/typo3-10