You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This request isn't a duplicate of an existing issue
I've read the docs and followed them (if applicable)
This is not a personal support request that should be posted on the Roots Discourse community
Description
This issue happens when using php 7.4 (as roots/trellis 1.4.0 does). In /web/app/mu-plugins/bedrock-autoloader.php on line 176 in the updateCache method of the Autoloader class. There is a check if $this->cache['plugins'] is an array by using is_array. However, $this->cache['plugins'] can be null at that point. As of php 7.4 is_array will no longer return null when the given variable is null, but throws a notice for invalid array access.
I was able to fix it by first checking if $this->cache is an array, like this: $rebuild = !(is_array($this->cache) && is_array($this->cache['plugins']));
Steps to reproduce
Use Bedrock in combination with php 7.4 (roots/trellis 1.4.0 for example).
Make sure you can see php notices.
Add a mu-plugin in the mu-plugin folder.
See the notices appear when opening the site.
Expected behavior:
No php exceptions or notices when using bedrock and php 7.4
Actual behavior:
A php notice when using bedrock and php 7.4
Versions
Bedrock 1.13.2
Trellis 1.4.0
OSX 10.14.6
The text was updated successfully, but these errors were encountered:
Description
This issue happens when using php 7.4 (as roots/trellis 1.4.0 does). In /web/app/mu-plugins/bedrock-autoloader.php on line 176 in the updateCache method of the Autoloader class. There is a check if
$this->cache['plugins']
is an array by usingis_array
. However,$this->cache['plugins']
can be null at that point. As of php 7.4is_array
will no longer returnnull
when the given variable isnull
, but throws a notice for invalid array access.I was able to fix it by first checking if
$this->cache
is an array, like this:$rebuild = !(is_array($this->cache) && is_array($this->cache['plugins']));
Steps to reproduce
Expected behavior:
No php exceptions or notices when using bedrock and php 7.4
Actual behavior:
A php notice when using bedrock and php 7.4
Versions
Bedrock 1.13.2
Trellis 1.4.0
OSX 10.14.6
The text was updated successfully, but these errors were encountered: