Yoast / Yoast-SEO-for-TYPO3

Yoast SEO plugin for TYPO3
Other
51 stars 56 forks source link

InvalidArgumentException Language -1 does not exist on site in InternalLinkingSuggestion #554

Closed abvdveen closed 11 months ago

abvdveen commented 12 months ago

Using Yoast 9.0.1, you get a 503 when trying to edit a CE that uses 'All languages' - id of which is -1. I 'fixed' this bij adding a condition and returning the default language in case the language id == -1:

        if($this->languageId != -1){
            $siteLanguage = $site->getLanguageById($this->languageId);
            return $siteLanguage->getTwoLetterIsoCode();
        }
        else return 'NL';
RinyVT commented 12 months ago

Hi @abvdveen!

I have actually merged a pull request today that fixes the exception but displays a message that the internal linking suggestions cannot be analyzed because the language is unknown: https://github.com/Yoast/Yoast-SEO-for-TYPO3/pull/544

I will have a look at the possibility to analyze the default language instead, so I'll keep this issue open :)