Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Continuing from #2885309: [PHP 7.2] each() function is deprecated
Found following instances of *each()* phpcs warnings in D7 Core (7.56).
FILE: .../includes/bootstrap.inc
----------------------------------------------------------------------
FOUND 1 ERROR AND 1 WARNING AFFECTING 2 LINES
----------------------------------------------------------------------
3782 | WARNING | Function each() is deprecated since PHP 7.2; Use a
| | foreach loop instead
----------------------------------------------------------------------
FILE: .../includes/install.inc
----------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------
782 | WARNING | Function each() is deprecated since PHP 7.2; Use a
| | foreach loop instead
----------------------------------------------------------------------
FILE: .../includes/menu.inc
----------------------------------------------------------------------
FOUND 0 ERRORS AND 3 WARNINGS AFFECTING 3 LINES
----------------------------------------------------------------------
579 | WARNING | Function each() is deprecated since PHP 7.2; Use a
| | foreach loop instead
2405 | WARNING | Function each() is deprecated since PHP 7.2; Use a
| | foreach loop instead
2435 | WARNING | Function each() is deprecated since PHP 7.2; Use a
| | foreach loop instead
----------------------------------------------------------------------
FILE: .../includes/module.inc
----------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
----------------------------------------------------------------------
407 | WARNING | Function each() is deprecated since PHP 7.2; Use a
| | foreach loop instead
543 | WARNING | Function each() is deprecated since PHP 7.2; Use a
| | foreach loop instead
----------------------------------------------------------------------
Comments
Comment #2
JayKandariComment #3
JayKandarireplaced all occurrences of each() method in D7. Kindly review.
Comment #5
Ayesh CreditAttribution: Ayesh commentedPHP 7.2 is finally released, and for anyone coming to this issue, I can confirm the patch above works well, except for one case.
In the menu.inc
_menu_load_objects
function, the $function variable is overwritten with the key of the same variable $function. This makes the nextcurrent
call to fail because $function is now a string. I also removed thenext()
call because the code down there was not iterating.I attached a patch against the current 7.x/6336b7177 plus an interdiff with patch at #3.
Comment #7
Neo13 CreditAttribution: Neo13 commentedHi.
After applying the patch I am getting a lot of warnings:
Warning: current() expects parameter 1 to be array, null given in _menu_load_objects() (line 579 in /var/www/html/includes/menu.inc).
Notice: Undefined variable: function_map in _menu_load_objects() (line 580 in /var/www/html/includes/menu.inc).
Warning: key() expects parameter 1 to be array, null given in _menu_load_objects() (line 580 in /var/www/html/includes/menu.inc).
Warning: Invalid argument supplied for foreach() in _menu_load_objects() (line 584 in /var/www/html/includes/menu.inc).
Warning: array_unshift() expects parameter 1 to be array, null given in _menu_load_objects() (line 600 in /var/www/html/includes/menu.inc).
Warning: call_user_func_array() expects parameter 1 to be a valid callback, no array or string given in _menu_load_objects() (line 601 in /var/www/html/includes/menu.inc).
Warning: call_user_func_array() expects parameter 2 to be array, null given in _menu_load_objects() (line 601 in /var/www/html/includes/menu.inc).
Comment #8
Ayesh CreditAttribution: Ayesh commentedThe patch at #5 was supposed to fix that current() call error, but it turns out I uploaded the wrong patch. Please undo that patch and try the new one attached.
Comment #9
Ayesh CreditAttribution: Ayesh commentedComment #11
sjerdoSome review comments for patch #8.
Coding standards: Add a whitespace between the foreach statement and the open parenthesis '('.
This introduces a bug. The $module variable is expected to contain the module name. Since the $module_list contains an array with module name as key and weight as value, the variable $module contains the weight. This line should be like
foreach ($module_list as $module '=> $weight) {
Coding standards: Add a whitespace between the foreach statement and the open parenthesis '('.
Same as above. No proper coding standards and $module contains the weight instead of the module name.
Same as above. No proper coding standards and $module contains the weight instead of the module name.
Should we also change the use of
each()
in the book.module module file? Function each() is still used twice in that file.Comment #12
Ayesh CreditAttribution: Ayesh commentedMakes sense the simpletest module couldn't be enabled at the CI tests.
Comment #13
Ayesh CreditAttribution: Ayesh commentedComment #15
sjerdoDid some testing and it seems like we should use next() and key()/current() instead of a foreach loop, since new values are added to the module list array while iterating over it.
For example:
Will result in 1234
Will result in 123
You can test this at 3v4l.org: https://3v4l.org/g77Ae
Comment #16
sjerdoDid some cleanup and implemented the key() / next() loop.
Comment #18
andypostBtw using iterators is nice but has
reset()
as requirement sometimesComment #19
sjerdoWe should also use current() and next() here, since the $callbacks array is a drupal_static() variable which be can be altered
Comment #20
sjerdoUpdated patch #16 so callbacks are also looped with current() and next().
Comment #21
andypostLooks still needs
reset()
Comment #22
vprocessor CreditAttribution: vprocessor at Skilld commentedAdded resets
Comment #24
piggito CreditAttribution: piggito as a volunteer and at Skilld commentedAdding back the changes in #20 to fix tests
Comment #25
andypostLooks good to go!
Comment #26
oriol_e9gI get the error:
Deprecated function: The each() function is deprecated. This message will be suppressed on further calls a _drupal_shutdown_function() (línia 3779 de /var/local/html/dadesobertes/includes/bootstrap.inc).
Applied the patch #24 and works with PHP 7.2.1
Comment #27
oriol_e9gPatch still aplies cleanly:
Comment #28
oriol_e9gI have found three extra occurrences in current code:
Comment #29
oriol_e9gComment #30
sjerdoSome review comments:
Assigment of $key is missing. Should be $key = key($flat);
Assigment of $key is missing. Should be $key = key($flat);
Comment #31
oriol_e9gOh! Extra:
The comment should be changed:
// Assigning the array to $flat resets the array pointer for use with each().
And
$curr
is not used, we really doesn't need the var, only need the key.Comment #32
oriol_e9gComment #34
David_Rothstein CreditAttribution: David_Rothstein as a volunteer commentedLooks like there's still one left:
So the patch fixes one of the each() calls in that block of code, but still leaves the first one behind (
while ($equal && list($id) = each($negotiation))
).--
In general, and maybe this is just personal preference, I have to say that I find
foreach()
(with abreak
statement if necessary) way more readable thannext()
,current()
, etc... anyone else? Not a commit blocker from my point of view, but if it were me I'd try to useforeach()
whenever possible.Comment #35
David_Rothstein CreditAttribution: David_Rothstein as a volunteer commentedWell actually, it also looks like the Drupal 8 patch at #2885309: [PHP 7.2] each() function is deprecated did use foreach() for a number of these... seems like we should at least use foreach() whenever that did if possible to do so; there isn't much reason to have the Drupal 7 and 8 fixes diverge unnecessarily.
Thanks for the work on this issue!
Comment #36
Ayesh CreditAttribution: Ayesh commented+1 for the
foreach()
preference. I'll try to re-roll the patch to a (hopefully) final one usingforeach()
whenever possible if the patch at #32 passes.Comment #38
oriol_e9gOK! Reroll! @Ayesh
For fixing test in do/while style do this:
but if you want to refactor in a foreach/break style I agree that it's more rediable.
Comment #39
David_Rothstein CreditAttribution: David_Rothstein as a volunteer commentedFor the locale.test one in particular, I have to say the Drupal 8 fix looks particularly enticing: http://cgit.drupalcode.org/drupal/commit/core/modules/language/tests/src...
It doesn't have to use foreach() or next()/current()/etc .... instead it just drastically simplifies the code :) Pretty sure we could do that here too.
Comment #40
oriol_e9gComment #41
oriol_e9gComment #42
mikeytown2 CreditAttribution: mikeytown2 commentedcount() will also fail if the variable is not countable. This patch should also address it; based off of #40.
Comment #44
delta CreditAttribution: delta as a volunteer commentedTested the latest patch #42, the line 1441 in form.inc cause all required fields to fail validation.
if it's not an array the first condition return TRUE, thus causing $is_empty_multiple to be TRUE and mark the field in error.
attached updated patch
edit: not all fields fail validation, only non-multiple fields that are #required.
Comment #45
delta CreditAttribution: delta as a volunteer commentedComment #47
delta CreditAttribution: delta as a volunteer commentedSo regarding the core original code it seems that:
was doing more than just detect empty multiple fields.
edit: the patch in #42 address more fix to count() calls, they need to be reviewed too.
Comment #48
mikeytown2 CreditAttribution: mikeytown2 commentedComment #49
mikeytown2 CreditAttribution: mikeytown2 commentedWe might have to do more than a one-liner to fix the $is_empty_multiple issue.
Comment #51
mikeytown2 CreditAttribution: mikeytown2 commentedGoing to silence the error on $is_empty_multiple to see if there is anything else causing issues.
Comment #53
andypostcurrent is lost
Comment #54
oriol_e9g$curr
is lost inbook_next()
because is not used, see all function.In
book_prev()
we have$curr
because is used:In your comment says that we miss current in book_prev but really this is missing in book_next, that it's correct:
Comment #55
oriol_e9gI have rerolled a patch based on #40 because this issue is about to
each
deprecation, notcount()
issues with PHP 7.2If we want to solve
count()
bugs and deprecations we can manage this in another issue.Comment #56
mikeytown2 CreditAttribution: mikeytown2 commentedSounds good. I'd RTBC this.
Comment #57
andypostFor
count()
I re-purposed issue #2932916: [PHP7] Warning: count(): Parameter must be an array or an object that implements Countable in PHP 7.2Comment #58
joseph.olstadComment #59
bkosborneI don't understand why the
reset()
was added all over. That will reset the internal pointer of the array to the first element, but it's not as thougheach()
was doing that?In other words, adding the reset() will reset the array to start whereas before this patch, that was not happening.
Comment #60
bkosborneAfter reading the docs I'm convinced it's not appropriate to add the resets(). But maybe someone can explain why they are needed?
Comment #61
bkosborneComment #62
joseph.olstad@bkosborne, please provide a new patch with your recommended changes.
Comment #63
oriol_e9g@bkosborne
Surely we can use
foreach
structures, and maybe is more redeable.I'm not interested in working on a new patch when we already have a solution that works, but if you want to provide a new patch using foreach style I will be glad to review it. In the meantime, if nobody wants to work in an alternative patch, I would appreciate that doesn't block the current solution.
Comment #64
yogeshmpawarSounds good to me +1 for RTBC. using this solution also all test passes.
Comment #65
joseph.olstadIt is nice that patch 58 passes, great work, however @DavidRothstein points out in comment #39 that the D8 fix in one case was very simple and yet not one replied to him #2925449-39: [PHP 7] Function each() is deprecated since PHP 7.2 [D7]
And he also had a suggestion in comment #35 to approach this in a similar way that D8 did with foreach #2925449-35: [PHP 7] Function each() is deprecated since PHP 7.2 [D7]
This will make it easier to maintain.
Meanwhile I used the patch #58 to test out #2947772: Fully support PHP 7.2 in Drupal 7
I am not sure why but when I combined this patch with the other one, there is one obscure fail, probably not caused by this patch but if anyone already has 7.2 working in their environment please have a look at 2947772 thanks.
Comment #66
bkosborneI'll address #65
Comment #67
bkosborneOk, here's my changes.
There appeared to be some bugs in the patch.
I replaced iterators with foreach loops where possible (and this is how the D8 version of the patch did it). This also fixed two bugs in the previous patch in the module_enable and module_disable code where the next() iterator was not called properly.
I also added some reset() calls to the book module where they were missing. The D8 version of patch did this as well.
The code in menu.inc seemed wrong too. I removed the two reset() calls since I don't think they belonged there.
Comment #69
bkosborneWill look at those test failures today
Comment #70
bkosborneOk I think the module installer / uninstaller are failing now because when we switched to a foreach(), but it looks like the installer is modifying the array in place, which I don't think behaves the same way with a foreach as it does with an each(). But if that's the case, then I think this may be broken in D8 as well and maybe there is just more coverage in D7. Will continue looking into it.
Comment #71
sjerdo@bkosborne I have already mentioned this in comments #19 and #20. That is why I used reset() and next() instead of a foreach loop.
Same for module_enable and module_disable. While these methods can enable/disable dependend modules
Comment #72
bkosborne@sjerdo, Indeed. I went back to the manual iterator that you added. I made one small change, which is putting the next() as the first line in the loop instead of the last. This more closely resembles what each() was doing (it immediately advances the array pointer) and avoids a potential issue where the next() wouldn't be called when the
continue;
code path is hit, forcing it to stay on the same item.I also removed one extra reset that doesn't appear necessary.
The interdiff is still diffed against the patch in #55.
Comment #74
bkosborneFix that last failing test by keeping the loop on reference for system shutdown function
Comment #75
bkosborneComment #76
joseph.olstadGreat work everyone, I think this can be RTBC on patch #74.
@bkosborne, and for everyone else, I've taken patch 74 and used it for 2947772 there's still one 7.2 fail , I took patch #74 (great work btw) and combined it with the other 7.2 patch , unfortunately there's still one failure but I don't think it's related to this issue.
Please see #2947772-5: Fully support PHP 7.2 in Drupal 7
and the test fail.
Comment #77
joseph.olstadComment #78
Fabianx CreditAttribution: Fabianx at Tag1 Consulting commentedApologies if questions I have, have been answered before in the discussion:
What is the reason to use a reference here in the loop?
Is that necessary to keep some BC somewhere?
I assume we checked that only the current module would be unset in this function, so that we could not run into the situation to visit an already unset $module?
I assume $key was unused here?
Nice comment.
$curr is unused here and not used below. Is it needed later?
Nice job!
Comment #79
bkosborneAddressing comments and will add new patch soon..
Comment #80
bkosborneEDIT: Oops, used a .patch extension on the interdiff. Ignore the obvious test failure that will produce.
1. Good question. This confused me initially so I removed it, but it (thankfully) caused tests to fail (specifically, "testShutdownFunctions" in system.test).
The original code looped over the shutdown functions using a manual iterator, which meant that shutdown functions added to the list by other shutdown functions would still be executed (that's a benefit of using a manual iterator as I've come to learn). But we changed it to a foreach, which operates on a copy of the array, so additional shutdown functions that were registered in the process of executing other shutdown functions were never called.
I guess you can force the foreach loop to NOT create a copy of the array by declaring that it's items should be referenced (like the patch shows). This is how the D8 version of patch did it so I copied it. But, it's not at all clear that this is the reasoning for the reference, so I'll convert this back to a manual iterator and add a comment.
2. I don't understand the scenario you're describing, can you elaborate?
3. That's right.
5. It is used, but in a round-a-bout way. It's used to help figure out what the
$prev
should be when the loop exits.---
Attached patch addresses the first comment.
Comment #82
bkosborneComment #83
bkosborneThe failures in PHP 7.2 are unrelated to the work in this patch.
Comment #84
joseph.olstadGreat work, however the simpletest is the true review.
Patch #51 has only 1 failure with php 7.2 ,
however patch #80 has 308 fails with php 7.2
how can this not be related?
why is patch #51 'almost' ready for php 7.2 , but patch #80 has 308 fails?
I notice that the patch #51 has only 1 fail, the same issue I was trying to resolve in #2947772: Fully support PHP 7.2 in Drupal 7
For the 1 fail, follow that up in 2947772
Comment #85
Fabianx CreditAttribution: Fabianx at Tag1 Consulting commentedThanks,
I sent #51 for a re-test on PHP 7.2 to see if the includes/form.inc error is related.
---
Using a reference is a good trick / side effect, however I like the explicit iterator more, so good for changing.
I think this can be changed back to RTBC and then committed - provided that #51 has the same number of test failures.
Comment #86
bkosborneHmm, nope, it had just 1 failure as before. Not sure what to make of that massive difference. Will try and look at this again tonight.
Comment #87
amme CreditAttribution: amme commentedSuppose there are differences between #51 and #80 because patch #51 contain also fix to 'count' function...
Comment #89
joseph.olstadyes, patch #80 should be RTBC provided test results match those of patch #55,
#87 is right the count issue was split to another issue, #80 can be compared with patch #55 , (I just queued it for php 7.2, expect the same 308 fail result)
also see comments #51, #52, #53, #54
For combining the 7.2 compatibility fixes, see:
#2947772: Fully support PHP 7.2 in Drupal 7
Comment #90
joseph.olstadThe previous patches were written against 7.56
appears that they no longer apply cleanly to 7.57.
patch 80 looks like it is correct. The 308 php 7.2 fails are out of scope.
Comment #91
mikeytown2 CreditAttribution: mikeytown2 commentedIf PHP 5.3 passes in #80 I'd RTBC this.
Comment #92
Fabianx CreditAttribution: Fabianx at Tag1 Consulting commentedThis needs a re-roll ...
Comment #93
sjerdoReroll of patch #80
Comment #95
joseph.olstadtestbot glitch, was choking on the interdiff added in comment #80, because of the .patch extension instead of .txt
hiding the interdiff.patch , this time the patches should apply cleanly
I will requeue patch #80 for php 5.3
Comment #97
joseph.olstadPatch #80 is good, the fails are due to some glitch in the testbot.
For testrunner issue, followup here:
#2916566: d7 contrib Testrunner Builds not working properly with stable
Comment #98
PolPatch #80 is fine for me as well, including it in our composer file by default.
Comment #99
joseph.olstadComment #100
MixologicRetested all of the failing patches.
Comment #101
mikeytown2 CreditAttribution: mikeytown2 commentedThanks Mixologic!
Passes all but 7.2 which will be fixed in #2947772: Fully support PHP 7.2 in Drupal 7
Comment #102
Fabianx CreditAttribution: Fabianx at Tag1 Consulting commentedI am happy with the patch now :).
Just not at a computer to commit it.
Comment #103
devu_divya CreditAttribution: devu_divya commentedIm getting the issue
Deprecated function: The each() function is deprecated. This message will be suppressed on further calls in _menu_load_objects() (line 579 of C:\Apache24\htdocs\drupal\includes\menu.inc).
I saw the above patches, but as I am new to drupal, I do not hv idea on to apply these patches. Pls help me here.
Comment #104
PolHi,
A simple Google query with 'Drupal how to apply patches" and you would have find the solution quicker than posting the message :-)
Anyway, here's the link that will help you: https://www.drupal.org/patch/apply
Comment #105
devu_divya CreditAttribution: devu_divya commentedThanks a lot Pol. It helped.
But can figure out why I m getting this. Completely new o drupla. :)
C:\Apache24\htdocs\drupal\includes>git apply -v deprecated_.patch
includes/deprecated_each_2925449-80.patch:10: trailing whitespace.
// Manually iterate over the array instead of using a foreach loop.
includes/deprecated_each_2925449-80.patch:11: trailing whitespace.
// A foreach operates on a copy of the array, so any shutdown functions that
includes/deprecated_each_2925449-80.patch:12: trailing whitespace.
// were added from other shutdown functions would never be called.
includes/deprecated_each_2925449-80.patch:13: trailing whitespace.
while ($callback = current($callbacks)) {
includes/deprecated_each_2925449-80.patch:15: trailing whitespace.
next($callbacks);
Skipped patch 'modules/book/book.module'.
Skipped patch 'modules/locale/locale.test'.
Checking patch includes/bootstrap.inc...
error: while searching for:
chdir(DRUPAL_ROOT);?
?
try {?
while (list($key, $callback) = each($callbacks)) {?
call_user_func_array($callback['callback'], $callback['arguments']);?
}?
}?
catch (Exception $exception) {?
error: patch failed: includes/bootstrap.inc:3776
error: includes/bootstrap.inc: patch does not apply
Checking patch includes/install.inc...
Comment #106
Ayesh CreditAttribution: Ayesh commentedReroll post-7.58 release.
@devu_divya: Try this new patch against the latest 7.x-dev version. Patches in issue queues are always made against the dev version of core or the contrib project.
Comment #107
joseph.olstadCrack open a bottle of bubbly! php 7.2 now passing all tests.
Great work everyone!
See:
#2947772: Fully support PHP 7.2 in Drupal 7
ready for commit
Comment #108
Fabianx CreditAttribution: Fabianx at Tag1 Consulting commentedAwesome work on getting the patch to pass!
Comment #109
S@ilor CreditAttribution: S@ilor commentedNot so fast ....
I had to roll back to PHP7.1, as I was getting fatal errors on Drupal 7 sites with 7.2
Following "Continue to the error page", I have this: "Fatal error trying to download."
Drush updating not a problem, though.
Comment #110
sjerdo@silor #109
That is a different issue. Apply the patch in #2946045: Unable to update modules due to Archive_Tar incompatibility with PHP 7.2
Comment #111
S@ilor CreditAttribution: S@ilor commented@sjerdo
Sorry, and thanks. Saw loads of these errors too, but yes; different issue.
Comment #112
ljndit CreditAttribution: ljndit commentedHello all, would appreciate any help you could provide. I installed Drupal 7 on my Win server running PHP 7 and MySQL 5. My search for the errors I received after the installation stated it completed lead me to this forum. I am currently trying to follow the wonderful guide here https://www.drupal.org/node/620014 to install this patch.
So far my question is, where should I have the patch file located in my website directory? The guide states within the module folder but these errors and patch if I am understanding correctly needs to be applied to the Drupal core files. This is a totally new endeavor for me. I worked in web hosting years ago and all these wonderful CMS systems were either 1 click installs or already installed. Now that I am doing this from scratch on my own development server I am having to relearn so much. Thank you again for any assistance you could provide.
Comment #113
MustangGB CreditAttribution: MustangGB commented@ljndit
I will answer your question, but the issue queue is not really the place for such questions, and even especially not in a "bug report".
You should either:
1) Ask on the forums, see https://www.drupal.org/forum
2) On the Slack #support channel, see https://www.drupal.org/slack
3) In a new issue of your own creation under the category "support request" (not very likely to get an answer, the other two options are preferred)
Anyway about your question, you apply module patches from within the corresponding module folder (as you mentioned already), patches to Drupal itself are performed from the root web directory, i.e. the folder with Drupal's index.php file.
Comment #114
Fabianx CreditAttribution: Fabianx at Tag1 Consulting commentedCommitted and pushed to 7.x. Thanks all!
Comment #117
magmatic CreditAttribution: magmatic as a volunteer commentedI would like to apply this patch to my existing D7 site, since I am also affected by PHP 7.2.
I've noticed that the fix has been pushed to 7.x, but 7.59 is still the latest, so this thing isn't out yet.
Can someone kindly tell me how to apply a patch to a site, and which patch to use?
Thank you!
Comment #118
siramsay CreditAttribution: siramsay as a volunteer commented@magmatic
here is a link to a useful tutorial on applying patchs
https://drupalize.me/videos/applying-and-creating-patches-git?p=1173
Comment #119
anonymous coward CreditAttribution: anonymous coward commented@magmatic , if you do not know how to apply patches or prefer not to, you can safely use the 7.x-dev branch of D7 which has all these php 7.2.x fixes.
https://www.drupal.org/project/drupal/releases/7.x-dev
Comment #120
vibrasphere CreditAttribution: vibrasphere commented7.60 rolled out and.... not committed.
Patching all sites... Again.
Comment #121
Ayesh CreditAttribution: Ayesh commentedSecurity releases do not contain bug fixes, so none of these PHP 7.2 fixes were included in the 7.60 release. Hopefully maintainers will finally merge and release a 7.61 with these changes.
Comment #122
vibrasphere CreditAttribution: vibrasphere commentedThis has been reported almost a year ago and you guys still rolling out updates with deprecated code for what reason exactly? And same was told about 7.60 that it will hopefully finally merge. So saying maybe it will merge with 7.61 means nothing, it's literally been almost a year.
Comment #123
Ayesh CreditAttribution: Ayesh commentedI know it was released almost a year ago, and in fact, I contributed patches on this issue and other 7.2-fix issues too.
Security releases don't contain any bug fixes, and they have to be coordinated with other branches (7.x, 8.6, etc), and these security fix patches are a PITA when commits are diverged.
For 7.x branch in particular, I believe we have new maintainers, who may need to catch up the speed. We should also keep in mind that we all are here as volunteers. That said, I am looking forward to get these finally released into a proper release as well, to keep our post-update-patch workflow minimal.
Comment #124
PolHi,
We are preparing the patches and commits for the upcoming release.
I'm doing all my best to have this one committed as well, it should be straightforward :-)
Sorry for the delay guys.
Comment #125
bart lambert CreditAttribution: bart lambert commentedUpdate today to Drupal 7.60 and apparently the "Function each() is deprecated since PHP 7.2 [D7]" is still an issue in menu.inc file.
I had to apply the patch manually again.
Comment #126
DamienMcKennaAs a reminder, you can always use the -dev snapshot of core until the next stable version is released.
Comment #127
PolI think I've been too hasty in my previous comment.
The patch in this issue has been released in 7.60, why do you still have to apply it manually?
Am I missing something?
Comment #128
DamienMcKenna@Pol: If you check the git log, 7.60 was the same as 7.59 with the new security fix added, it didn't include everything else committed on the 7.x branch, the last time there was a feature release of D7 it was 7.55.
Comment #129
joseph.olstadto fix the d7 dev branch that was short circuited by 7.60 you could simply cherry-pick all the commits they skipped in the 7.60 release
git clone d7core
cd d7core
git checkout 7.x-dev
git cherry-pick HASHKEY
repeat for all of these commits:
https://cgit.drupalcode.org/drupal/commit/?h=7.x&id=083a4eca4a2ebc5276ee...
https://cgit.drupalcode.org/drupal/commit/?h=7.x&id=b014c196e1eab417e070...
https://cgit.drupalcode.org/drupal/commit/?h=7.x&id=76a4dc7098771a14e7d6...
https://cgit.drupalcode.org/drupal/commit/?h=7.x&id=73e12f0ddf1ed60c1333...
https://cgit.drupalcode.org/drupal/commit/?h=7.x&id=28de6772813387bf02a4...
https://cgit.drupalcode.org/drupal/commit/?h=7.x&id=127ffe91fffb5813c324...
https://cgit.drupalcode.org/drupal/commit/?h=7.x&id=dcf8c646fbab4f9fbb0d...
https://cgit.drupalcode.org/drupal/commit/?h=7.x&id=ee301cf5ebff3534b59f...
this should bring all these commits back into head of 7.x-dev branch
maybe there's a better way, but would get us back on track. Currently all 7.x-dev testing is going to fail on php 7.2.x until this is fixed.
Comment #130
jacob.embree CreditAttribution: jacob.embree at St. Louis Integration commented@joseph.olstad
The release of 7.60 without all those commits did not affect 7.x branch at all. 7.x still has all those commits, plus the security fix. Testing will go on as before.
(There is no "7.x-dev" branch of core.)
DamienMcKenna is correct. Everyone using a dev snapshot will have the fix in this issue.
Comment #131
joseph.olstadok thanks for the clarification.
so 7.x branch has the fixes. I stand corrected, this is good thanks!
Comment #132
dks786 CreditAttribution: dks786 commentedHow to check/test patches? like
7.x: PHP 7 & MySQL 5.5 2,041 pass PHP 5.3 & MySQL 5.5 2,036 pass, 4 fail
Comment #133
joseph.olstadThese patches are already in 7.67 release the main drupal core qa testing runs automatically all those versions of php are currently passing all tests. Go to the drupal core project page and click on the rightmost tab after version control and releases