New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix Cannot use a scalar value warning #15600
Conversation
Per #15548, multiple Cannot use a scalar value as an array warning are showing on many sites after update to Joomla 3.7
Thanks for doing this whilst I was out! |
The only difference is the variable name? |
Correct. Should line 604 be |
If yes, then #15641 can be closed. |
@wilsonge @Quy They should NOT be the same I think. The previous, deprecated methods signatures are different. For stylesheet, we test only the second parameter ($attribs) because the first ($options) was also an array in both old and new signature. As you can see in the next lines, the code to handle $attribs and $options is not the same. |
No, it's about how the method is called.
So the way to detect whether the call is with the new or old syntax is by looking at the 3rd parameter. If an array, it's the new syntax. If not an array, then it 's the old syntax. |
Per joomla#15548, multiple Cannot use a scalar value as an array warning are showing on many sites after update to Joomla 3.7
I am not sure what I should edit to fix this issue. Can someone give some advice? Thanks, This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/15600. |
@tracylee3124 Maybe best is to wait until a new Joomla release is available? I suspect there might be one coming, though @wilsonge or @rdeutz would know better. If you don't want to wait, you should apply the modification displayed on the "Files changed" tab of this page. The link to there is: https://github.com/joomla/joomla-cms/pull/15600/files Be sure to always be able to restore any file you modify this way, in case something goes wrong. |
Per #15548, multiple Cannot use a scalar value as an array warning are showing on many sites after update to Joomla 3.7
Pull Request for Issue # 15448.
Summary of Changes
Removed test on $attribs being an array. Issue analysis by George Wilson is here: #15548 (comment)
Testing Instructions
On site showing those warnings, applying the patch should stop them, and restored functionalities that may be broken (Some Payplans features stop working) because the corresponding javascript file is actually not inserted in the page.
Expected result
Actual result
Documentation Changes Required