Skip to content
This repository has been archived by the owner on Sep 16, 2019. It is now read-only.

Error notice referencing enqueue-scripts.php #1128

Closed
AmyGail opened this issue Oct 12, 2017 · 9 comments
Closed

Error notice referencing enqueue-scripts.php #1128

AmyGail opened this issue Oct 12, 2017 · 9 comments
Labels

Comments

@AmyGail
Copy link

AmyGail commented Oct 12, 2017

Hello All.
I just installed the latest version and received the following notice on activation.

"( ! ) Notice: Only variables should be passed by reference in /.../enqueue-scripts.php on line 18".

Here's a screenshot in case it's helpful.
Thanks for all your hard work.

screen shot 2017-10-12 at 4 00 07 pm

@JPOak
Copy link
Contributor

JPOak commented Oct 12, 2017

@AmyGail What version of PHP are you running on Mamp. I am guessing it is old.

@AmyGail
Copy link
Author

AmyGail commented Oct 12, 2017

I'm on 7.1.1

@JPOak
Copy link
Contributor

JPOak commented Oct 12, 2017

@AmyGail I just tested on 6.4 and 7 and have no error. However, I did test on an older version of PHP and I get the error. @colin-marshall any comment here? i think it has to do with the usage asset_path function and line 18. Maybe we should tweak...

@colin-marshall
Copy link
Collaborator

@JPOak I guess we should have tested that before merging. The solution is to store the result of explode in a variable and then run the end function on that variable. Source:
https://stackoverflow.com/a/4636183/2755888

@JPOak
Copy link
Contributor

JPOak commented Oct 12, 2017

@colin-marshall I was looking at that exact stack!

@JPOak
Copy link
Contributor

JPOak commented Oct 12, 2017

@AmyGail On line 18 replace that with the below and see if that works.

$tmp = explode('.', $filename);
$dir = end($tmp);

@AmyGail
Copy link
Author

AmyGail commented Oct 12, 2017

Looks like it works!

@JPOak
Copy link
Contributor

JPOak commented Oct 12, 2017

@AmyGail Sorry about that. We added a new asset hashing feature and still working out the kinks. I will do a PR now for that fix.

@AmyGail
Copy link
Author

AmyGail commented Oct 12, 2017

No worries! I appreciate the quick fix.
Thanks.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants