The each() function is deprecated as of PHP 7.2.
ParagraphsItemEntity.inc contains one instance of each() that should be replaced.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | deprecated_each-2951390-2.patch | 528 bytes | joegraduate |
The each() function is deprecated as of PHP 7.2.
ParagraphsItemEntity.inc contains one instance of each() that should be replaced.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | deprecated_each-2951390-2.patch | 528 bytes | joegraduate |
Comments
Comment #2
joegraduateComment #3
berdirLooks good.
Comment #4
cobadger commentedThe patch eliminated the php7 warning.
Comment #5
banoodle commentedHi and thanks for the patch!
Can someone provide me with details on how to reproduce this warning? We're not seeing this warning (and we have all warnings/errors and logging enabled) and I would ideally like to reproduce the warning prior to patching.
I know I may sound overly cautious, but this is for a very complex and highly customized site (that I didn't create), so I'd like to be sure I'm scrutinizing the right part of the module's functionality so as to not introduce new problems. I looked at the one occurrence of each() in the code and I think it should get invoked when a paragraph is added to a node entity (but I'm not sure). I tried adding paragraphs and nested paragraphs to nodes and also to content types, comments and taxonomy terms, but nothing is generating a warning.
Comment #6
vinmassaro commentedPatch works, thanks!
Comment #7
joe_carvajalThe patch worked for me also.
I think it's ready to be merged.
Thank you!
Comment #8
joe_carvajal@banoodle In my case, there are no nested paragraphs and the warning is being showed. There are just different kind of paragraphs added to a single node (to a multivalued paragraph field). The warning is showed on node save.
Comment #9
salvisThis is what I'm seeing:
I'm getting this in the watchdog log from a node with a simple paragraph with an image in an Image field (and text). Actually I'm getting it from retrieving the image from the private file system path, not the node itself.
I applied #2 to 7.x-1.0-rc5 and it fixes the issue.
Comment #10
gbirch commentedFWIW, patch #2 solves problem for me too. PHP 7.2
Comment #11
salvisWhat does it take to get this committed?
Comment #12
Chris Gillis commentedLet's please commit this?
Comment #13
shaneonabike commentedAgreed can we push this to the latest dev it's clogging up log files and a fairly easy fix
Comment #14
altagrade commentedPatch in #2 worked for our use case too.
Comment #15
salvisWhat gives, @Berdir?
Comment #16
anybodyConfirming RTBC. 7.2 is widely used and this message fills up logs. Thank you all!
Comment #17
kreynen commentedJust deployed this to production.
Judging by the fact that the latest stable release of the D7 branch was February 2017 and there are 19 patches at RTBC, is it safe to say the D7 branch needs additional maintainers?
I looked for a meta issues about this, but #2692035: Backport 8.x tests to 7.x was the closest issue I could find.
With only 5 months until PHP7.1 is stops receiving security update and is truly EOL, cleaning up some of these PHP7.2 issues and noise is going to impact more installs.
Comment #18
miro_dietikerI committed this change to clean-up the queue. Thx all for pushing. :-)
Comment #21
joseph.olstadHello @mirio_dietiker, a release is within reach, every issue is marked RTBC reviewed and tested, it's tee'd up, just need someone to drive it home so we can get a tagged release of paragraphs 7.x-1.0-rc6 or 7.x-1.0?
#3027981: Plan for Paragraphs 7.x-1.0
Comment #22
anybodyRe-Confirming #22 - a new tagged release containing this PHP7 fix before Drupal 7 EOL would be lovely :)
Comment #23
anybody2 years later no tagged release fixing this... sad story. ;)
Comment #24
anybodyComment #25
joseph.olstad@Anybody, please add your comment to #3027981: Plan for Paragraphs 7.x-1.0
Comment #26
joseph.olstad#3391085: Plan for Paragraphs 7.x-1.1
#3027981: Plan for Paragraphs 7.x-1.0