While running a PHP version test against local codebase for PHP 7.2 compatibility, I received the following warning coming from fieldable_panels_pane.class.php version 7.x-1.10.

FILE: ../docroot/sites/all/modules/contrib/fieldable_panels_panes/plugins/export_ui/fieldable_panels_pane.class.php
------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
------------------------------------------------
138 | WARNING | Since PHP 7.0, functions inspecting arguments, like func_get_args(), no longer report the original
value as passed to a parameter, but will instead provide the current value. The parameter "$item" was used, and possibly changed (by reference), on line 125.

Comments

wstocker created an issue. See original summary.

wstocker’s picture

Issue summary: View changes
wstocker’s picture

Issue summary: View changes
damienmckenna’s picture

Version: 7.x-1.10 » 7.x-1.x-dev
Component: User interface » Code

Thanks for reporting that, Wendy.

cboyden’s picture

Status: Active » Needs review
StatusFileSize
new835 bytes

The approach I've seen some other modules take to fix this is to call func_get_args() as early as possible and assign the result to a variable, then use that variable later on. Here's a patch; after this change I'm no longer getting the warning from phpcs.

ruyakhokhar’s picture

Assigned: Unassigned » ruyakhokhar
ruyakhokhar’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new58.11 KB

Hi all, Patch #5 works fine for me. Screenshot attached for the same.

ruyakhokhar’s picture

Assigned: ruyakhokhar » Unassigned
damienmckenna’s picture

chaseontheweb’s picture

Title: PHP 7.2 compatibility warning in views_ui.class.php » PHP 7.2 compatibility warning in fieldable_panels_pane.class.php

  • DamienMcKenna committed bc478c3 on 7.x-1.x authored by cboyden
    Issue #3087902 by cboyden, ruyakhokhar, wstocker, DamienMcKenna: PHP 7.2...
damienmckenna’s picture

Status: Reviewed & tested by the community » Fixed

Committed. Thank you.

Status: Fixed » Closed (fixed)

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