Do not block the DevTools language switch if viewing a non-CMS page
authorAlexander Ebert <ebert@woltlab.com>
Sat, 4 Dec 2021 15:14:49 +0000 (16:14 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Sat, 4 Dec 2021 15:14:49 +0000 (16:14 +0100)
com.woltlab.wcf/templates/__devtoolsLanguageChooser.tpl

index 91864470ccbe7bc2163fa685e07fb6ac85262b6d..6c07b27a1ce41eb5f59a1146b288571df894b612 100644 (file)
                                }
                                
                                var alternateLink = elBySel('link[rel="alternate"][hreflang="' + languageCode + '"]');
-                               if (alternateLink) {
+                               if (
+                                       alternateLink
+                                       && document.body.dataset.application === "wcf"
+                                       && document.body.dataset.template === "cms"
+                               ) {
                                        // Check if the page does not have unique links per language, such as for the landing page.
                                        var currentLink = elBySel('link[rel="alternate"][hreflang="{$__wcf->getLanguage()->getFixedLanguageCode()}"]');
                                        if (!currentLink || currentLink.href !== alternateLink.href) {