Closed (fixed)
Project:
Chaos Tool Suite (ctools)
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
12 Oct 2018 at 10:54 UTC
Updated:
16 Sep 2019 at 22:10 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
stephenrobinson commentedComment #3
joelpittetPlease let us know in the issue summary the steps to reproduce this Warning as many have not reported it yet and I've not seen it personally.
Also we usually put the version to the -dev release as that is where we may have fixed it already so please test this against the 7.x-1.x-dev branch to ensure it hasn't already been fixed.
Googling that error it looks like it may be a false positive: https://github.com/sstalle/php7cc/issues/127
Comment #4
jweowu commentedOn account of the backwards-incompatible changes made in PHP 7.0, it's helpful to move any calls to
func_get_arg()andfunc_get_args()to the start of the function (even when the original location was safe in practice), in order to reduce cognitive load for the reader.Refer to https://secure.php.net/manual/en/migration70.incompatible.php#migration7...
This patch addresses all such instances in ctools with the exception of
ctools_access_menu(), in which I judged that the call was so close to the start (and obviously fine) that it was better to leave it as-is.(I'm happy to re-roll with that instance edited as well, though.)
Comment #6
joelpittetThanks for the patch and the explanation @4jweowu. I've committed your patch to the -dev branch.
Comment #7
joelpittetThis fix ensures those args are working the same way they were in PHP 5.x
Comment #9
sudheeshps commented@joelpittet, any idea when this will be added to a stable release?
Comment #10
joelpittetGood question, we usually plan around an issue like this: #2984057: Plan for CTools 7.x-1.15 release
Comment #11
joelpittetComment #12
gmario commentedHi, for ctools 7.x-1.12 the patch in #4 does not apply, here a new one with little fixes.
Comment #13
loon commentedOn the last version 7.15 I found the same issues:
Comment #14
joelpittetThis has been fixed a while ago in the latest stable release. If there is new issues found please file a new issue please.
Comment #15
jweowu commentedDefinitely new. Neither
ctools_access_menu()norpage_manager_search_page()are touched by the original patch/commit.This pattern is something for the maintainers to keep an eye out for in general. Any time you see either
func_get_arg()orfunc_get_args()in new code, and they're not happening right at the start of the function, the issue should be "Needs work".Comment #16
joelpittetPlease file a new issue for these remaining items.
This was committed last year in November, typically we don't reopen old issues, mostly to avoid duplicate and confusing commit messages.
Comment #17
joelpittetI've filed that new issue #3046695: Error with PHP7 - "func_get_args" might have been modified and credited @gmario and @loon
Comment #18
robpowellComment #19
jweowu commentedAs you didn't explain that tag change, I'm changing it back, because "Function argument(s) returned by "func_get_args" might have been modified func_get_args();" is an issue starting from PHP 7.0.