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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

sammarks15 created an issue. See original summary.

sammarks15’s picture

Attached patch.

sammarks15’s picture

Status: Active » Needs review

Forgot the status!

sylus’s picture

Status: Needs review » Reviewed & tested by the community

This 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

sergeypavlenko’s picture

Hi, all

Patch works fine! Thanks!

mollux’s picture

Status: Reviewed & tested by the community » Needs review
FileSize
1.53 KB

The is another place where the Uniform Variable Syntax is being used, in excludes/export.inc.

The attached patch fixed both places.

sylus’s picture

Status: Needs review » Reviewed & tested by the community
SylvainM’s picture

#6 works fine for me too, thx

klausi’s picture

Issue tags: +PHP 7.0 (duplicate)
mikeytown2’s picture

heddn’s picture

+1 on RTBC.

mikeytown2’s picture

Quick tip: This will find all Uniform Variable Syntax issues.

grep -rn -e "->\$[a-zA-Z0-9_]*\[" ./

nagy.balint’s picture

joelstein’s picture

Works for me. Closing #2710923: Bulk export with PHP 7 issues PHP notices as duplicate, where I wrote this exact same patch. :)

mudjunky’s picture

Works like a charm. Thanks!

rodrigoaguilera’s picture

+1 to commit this

Matroskeen’s picture

+1 on RTBC

MustangGB’s picture

  • japerry committed 79bcc03 on 7.x-1.x authored by mollux
    Issue #2635876 by sammarks15, mollux: PHP7 - Uniform Variable Syntax...
japerry’s picture

Status: Reviewed & tested by the community » Fixed

Looks good to me too. Fixed.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.