Publisher does not support the Fluid field type. Please do not contact asking when support will be available.

If you purchased an add-on from expressionengine.com, be sure to visit boldminded.com/claim to add the license to your account here on boldminded.com.

Ticket: Publisher redirecting to EN URL title from translated URL title (showing translated content)

Status Backlog
Add-on / Version Publisher 3.10.1
Severity
EE Version 7.3.12

Dotcom Developers

Nov 13, 2023

We have a DE Resource with a URL Title of iphone-und-ipad-gerateverwaltung-fur-anfanger, but when we try going to .../de/ressourcen/e-books/iphone-und-ipad-gerateverwaltung-fur-anfanger/ Publisher redirects to .../de/ressourcen/e-books/iphone-and-ipad-management-for-beginners/ with the English URL Title (but it still loads the DE content). We’re running into a few strange redirect issues that are redirecting when we aren’t expecting it to, and ext.publisher.php:1287 is the cause of a couple cases.

#1

Dotcom Developers

Comment has been marked private.

#2

BoldMinded (Brian)

In Publisher’s Misc settings, what is the Auto Redirect setting value?

#3

Dotcom Developers

Yes, redirect to valid translated URL

#4

BoldMinded (Brian)

Can you also zero in on the channel_titles and publisher_titles entry rows for an entry that is having this issue and share screenshots of the row values? I’m trying to replicate this locally and having trouble doing so. In my original comment, where I copy/pasted stuff from our Slack chat it mentions line 1287… is that line still valid for you or is it on a different line now? 1287 in my current version is a random line doesn’t seem relevant. What is the new line number or copy/paste the relevant lines of code you think this is originating from?

#5

Dotcom Developers

This is the block that line number was referencing:

// If the user ends up at a URL that is not valid, redirect them to the appropriate place.
            // This will only work for template_group/template based URLs. Matching Structure/Pages
            // based URL patterns would be much more complicated.
            $autoRedirect = $this->setting->get('auto_redirect');
            if ($autoRedirect && !$this->request->isDraftRequest()) {
                $currentUrl = $this->url->getCurrentUrl();
                $translatedUrl = $this->url->getTranslatedUrl($currentUrl, $this->request->getCurrentLanguage());
                if ($translatedUrl != $currentUrl) {
                    if ($autoRedirect == 'valid') {
                        $type = $this->setting->get('redirect_type');
                        header('X-Publisher-Redirect: Ext->core_template_route()', false);
                        ee()->functions->redirect($translatedUrl, $type);
                    } elseif ($autoRedirect == '404') {
                        $this->throw404();
                    }
                }
            }

We made changes in the database to fix the occurrences of this that were causing inconsistencies in our sitemap, so I will need to get back to you with some replication screenshots when I have a chance.

Login to reply