I was toying with PHP7 and features to notice that all of my exported panel pages were being overwritten by the previous, and that only one panel page was being imported at a time. Whenever I would go to revert the panel pages in an effort to get the one I exported back, it would delete the one I already had on my system and then not create it again.
I discovered that PHP7 changed their Uniform Variable Syntax (according to this section of a lovely PHP7 reference document). After updating the offending section inside page_manager_page_manage_pages_to_hook_code()
inside page_manager.module
, my page exports inside my features packages were working again (after re-exporting them again, of course).
I'm unaware of any other places the Uniform Variable Syntax is being used like this, but I would guess it's not used in that many places because I've been using page manager and features rather heavily without issue.
Comment | File | Size | Author |
---|---|---|---|
#6 | ctools-uniform-variable-syntax-2635876-6.patch | 1.53 KB | mollux |
Comments
Comment #2
sammarks15 CreditAttribution: sammarks15 at Able Engine commentedAttached patch.
Comment #3
sammarks15 CreditAttribution: sammarks15 at Able Engine commentedForgot the status!
Comment #4
sylus CreditAttribution: sylus commentedThis seems to solve related issues over in the features queue: #2642642: Features with Page Manager pages appear overridden in PHP 7
Important snippet from the PHP7 Reference Manual
Code that relied upon the old evaluation order must be rewritten to explicitly use that evaluation order with curly braces (see middle column of the above). This will make the code both forwards compatible with PHP 7.x and backwards compatible with PHP 5.x
Comment #5
sergeypavlenko CreditAttribution: sergeypavlenko commentedHi, all
Patch works fine! Thanks!
Comment #6
mollux CreditAttribution: mollux commentedThe is another place where the Uniform Variable Syntax is being used, in excludes/export.inc.
The attached patch fixed both places.
Comment #7
sylus CreditAttribution: sylus commentedGood catch!
Same points as #2635876-4: PHP7 - Uniform Variable Syntax updates are causing exported pages to not have names. apply ^_^ and tested on TravisCI.
Comment #8
SylvainM CreditAttribution: SylvainM at Axess Open Web Services commented#6 works fine for me too, thx
Comment #9
klausiMarked #2689481: Exports broken with PHP 7 as duplicate.
Comment #10
mikeytown2 CreditAttribution: mikeytown2 commentedMarked #2640404: PHP 7 Undefined property: stdClass::$Array in page_manager_page_manager_pages_to_hook_code as a dup
Comment #11
heddn+1 on RTBC.
Comment #12
mikeytown2 CreditAttribution: mikeytown2 commentedQuick tip: This will find all Uniform Variable Syntax issues.
grep -rn -e "->\$[a-zA-Z0-9_]*\[" ./
Comment #13
nagy.balint CreditAttribution: nagy.balint commentedComment #14
joelstein CreditAttribution: joelstein commentedWorks for me. Closing #2710923: Bulk export with PHP 7 issues PHP notices as duplicate, where I wrote this exact same patch. :)
Comment #15
mudjunky CreditAttribution: mudjunky commentedWorks like a charm. Thanks!
Comment #16
rodrigoaguilera+1 to commit this
Comment #17
Matroskeen+1 on RTBC
Comment #18
MustangGB CreditAttribution: MustangGB commentedComment #20
japerryLooks good to me too. Fixed.