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: Deprecation errors showing on php 8.1 or above

Status Resolved
Add-on / Version Publisher Lite 3.11.0
Severity
EE Version 7.4.0 dp42

Gavin @ JCOGS

Jan 18, 2024

Running site with php 8.1 see the following error reported twice on some pages on public site.

  Severity: E_DEPRECATED

Deprecated
str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated

user/addons/publisher/Service/ChannelField.php, line 176

#1

BoldMinded (Brian)

Anything else in this stack trace so I can see what is calling that to make the variable null?

#2

Gavin @ JCOGS

It’s a new site to me, I’m currently just doing an EE4->EE7 update so not familiar with templates etc. But based on my own work to sort out such deprecation warnings, there are two issues - why null is being passed to the str_replace function of course, but also (since clearly this can happen) updating the line itself to check that string exists before calling function. If I can find information to help you solve the first issue I’ll post it here. Fixing second issue is unlinked from anything that we might learn from configuration of this site, but in the interim the warnings annoy / upset the client.

#3

BoldMinded (Brian)

Try adding this conditional to the beginning of that method. Since it returns a bool or string it might be safe to bail early. Still curious as to what condition is causing $field to be null though.

public function getType($field)
    {
        if (!$field) {
            return false;
        }
#4

Gavin @ JCOGS

Thanks - adding the extra clause fixed the issue. If I can work out where / why null is getting sent to the function I will of course let you know.

Login to reply