User tests: Successful: Unsuccessful:
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.
Removed test on $attribs being an array. Issue analysis by George Wilson is here: #15548 (comment)
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.
Status | New | ⇒ | Pending |
Category | ⇒ | Libraries |
Status | Pending | ⇒ | Fixed in Code Base |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2017-04-27 12:52:47 |
Closed_By | ⇒ | wilsonge | |
Labels |
Added:
?
|
The only difference is the variable name?
Correct. Should line 604 be if (!is_array($options))
?
@wilsonge @Quy They should NOT be the same I think. The previous, deprecated methods signatures are different.
stylesheet(file, attribs, relative, pathOnly, detectBrowser, detectDebug)
vs
script(file, framework, relative, pathOnly, detectBrowser, detectDebug)
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.
stylesheet() can be called either with:
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.
The variable names are not what matters, it's more about the ordering.
We just updated to Joomla! 3.7.0 and I started getting this warning message on the panel that allows you to upload documents and add a link to the page. I was having trouble uploading files using that.
I am not sure what I should edit to fix this issue.
Can someone give some advice?
Thanks,
Tracy
@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.
Thanks for doing this whilst I was out!