All add-ons currently require PHP 7.4 or greater.

On July 4th 2024 PHP 8.2 will be the new minimum requirement for all add-ons. Expect any add-on released after that date to require 8.2 or greater. Some releases may not immediately take advantage of 8.x specific features in PHP, which means you might, be able to continue using new releases in PHP 7.4, however, if you experience an error the first thing you should do is update to PHP 8.2 then create a support ticket if the error persists.

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: Breaking deprecation error on switching languages

Status Resolved
Add-on / Version Publisher 3.10
Severity
EE Version 7.2.17

Hop Studios

May 08, 2023

Clicking the change language button presents a deprecation error, and breaks the page reload if debugging is turned on.
EE: 7.2.17
Publisher: 3.10
PHP: 8.1.18

Example code:

{exp:publisher:languages show_current="no"}
    <a  href="{switch_language_url}">{if publisher:current_language_id == 1}Fran├žais{if:else}English{/if}</a>
{/exp:publisher:languages}

In case that href tag doesn’t render properly, it’s the standard language switch tag: {switch_language_url}

https://i.gyazo.com/99ff7ecd77dbb1d3679e7475f2fbebce.png

Quick fix:
/publisher/Service/Url/Url.php:660

public function addTrailingSlash($url, $compareUrl = '', $siteIndex = null)
#1

BoldMinded (Brian)

Thanks for pointing this out. I think I’m going to update the whole function to this if you want to try it:

public function addTrailingSlash(string $url, string $compareUrl = '', string $siteIndex = '') :string
    {
        if (!$siteIndex) {
            $siteIndex = ee()->config->item('site_index');
        }

        if ($siteIndex && strpos($url, $siteIndex) !== false && strpos($url, '.php/') === false) {
            $url = str_replace($siteIndex, $siteIndex.'/', $url);
        }

        $uriParts = explode('?', $compareUrl);
        $compareUrl = $uriParts[0];

        if ($url && $compareUrl && substr($compareUrl, -1) === '/') {
            $url .= '/';
        }

        return reduce_double_slashes($url);
    }

Login to reply