Jump to content

Recommended Posts

Posted

With latest stable or later version of ProcessWire, PHP 7.4x I'm getting error: 

Call to a member function getDefault() on null 

841:            $langName = $this->wire('languages')->getDefault()->name;

I don't have multi-language support installed so I'm not sure if this has anything to do with it?

 

  • 4 weeks later...
  • 1 month later...
Posted
On 3/25/2021 at 2:35 AM, Kiwi Chris said:

With latest stable or later version of ProcessWire, PHP 7.4x I'm getting error: 

Call to a member function getDefault() on null 

841:            $langName = $this->wire('languages')->getDefault()->name;

I don't have multi-language support installed so I'm not sure if this has anything to do with it?

 

Thanks. fixed.

  • Like 1
  • 5 months later...
  • 3 years later...
Posted

Ran into a little bit of an odd issue with this, but not sure if this module is to blame, or PW.

I've found when saving blank values in php 8.3 - which includes the initial save that happens when making a new page - you hit this error with a core PW file

Fatal Error: Uncaught TypeError: count(): Argument #1 ($value) must be of type Countable|array, null given in wire/core/FieldtypeMulti.php:257

This happens even though the field I've made is a single "select" type

This is a pretty common php 8 issue I believe, which could presumably be changed by fixing 

if(!count($values)) {

to

if(empty($values)) {

but I wouldn't say I was a php expert enough to be confident in the potential repercussions of this, nor whether this is something that should even be changed in PW since it only seems to get tripped up by this module.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...