Extension, Module

Archived
Forum
(read-only)

Stash

ExpressionEngine 2, ExpressionEngine 3, ExpressionEngine 4, ExpressionEngine 5, ExpressionEngine 6

Back to this add-on's main page
View Other Add-ons From Mark Croxton

     

Nested embed errors with PHP 7.2

Bug Report

stefanos
stefanos

Hi Mark,

There is a problem with Stah( 3.0.6)  Embeds and PHP 7.2.
EE version: 3.5.15

Inside the JS script main file embed, there is an other embed ( test, JS code too)

JS code

{stash:embed:test}

 

Under PHP < 7.2 it is working fine, no message error, but with PHP 7.2 this message error appears:

Warning
count(): Parameter must be an array or an object that implements Countable
D:/sites/cistoarac/system/user/addons/stash/mod.stash.php, line 843 hide details

Severity: E_WARNING

Changing to PHP 7.1, no more message error.

Reading PHP.net manual:

Warn when counting non-countable types ¶
An E_WARNING will now be emitted when attempting to count() non-countable types (this includes the sizeof() alias function).

from: http://php.net/manual/en/migration72.incompatible.php

 

Thanks for your great work and support,

Best,

Stéphane

 

Mark Croxton
# 1
Developer
Mark Croxton

Thanks I’ll look into it!

Texcam Admin
# 2
Texcam Admin

Hi, Mark,

Wondered if you were able to address and fix this?  My migration requires 7.2.

Thanks,

Paul

stefanos
# 3
stefanos

Using Stash I’ve just did a small modification and no more error message. I will have a look to remember what I did.

Texcam Admin
# 4
Texcam Admin

That would be awesome, thanks.

stefanos
# 5
stefanos

I’m using the original last version of Stash, it works like a charm with PHP 7.2

Texcam Admin
# 6
Texcam Admin

If you don’t mind, can you confirm what version?  Thanks.

stefanos
# 7
stefanos

Stash 3.0.6 version,  EE 4.3.6, PHP 7.2.4.

Texcam Admin
# 8
Texcam Admin

Thanks, stefanos:

I have:
Stash 3.0.6 version,  EE 4.3.6, PHP 7.2.10 on Ubuntu 18.04.

And the issue did not resolve for me.

Using Operator Precedence seems to have fixed it, changing all instances involving ‘explode’ (5 in total):

count( explode(’:’, $name) == 1
to
((count( explode(’:’, $name)) == 1

I hope this won’t cause any other strange issues (Mr. Croxton?).

Thanks for your input and taking the time to respond, though.  It led me further to an answer.

stefanos
# 9
stefanos

Nice you have fixed it.
When the message error appears?

Mark Croxton
# 10
Developer
Mark Croxton

This is fixed in Stash 3.0.8
https://github.com/croxton/Stash