When loading a D7 site that has Views PHP installed, I get the message below when opening the site.
DEPRECATED: REQUIRED PARAMETER $INPUT FOLLOWS OPTIONAL PARAMETER $CHECKBOX IN ...\SITES\ALL\MODULES\VIEWS_PHP\VIEWS_PHP.MODULE ON LINE 44

CommentFileSizeAuthor
#4 3254385-4.patch7.65 KBandregp

Issue fork views_php-3254385

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

frank.schram created an issue. See original summary.

frank.schram’s picture

Title: EPRECATED: REQUIRED PARAMETER $INPUT with PHP 8.0 » DEPRECATED: REQUIRED PARAMETER $INPUT with PHP 8.0
andregp’s picture

Assigned: Unassigned » andregp
Issue tags: +Coding standards, +Novice

Its a simple case of changing the order of parameters to follow Drupal standard of letting all optional parameters at last.
I'll fix it.

andregp’s picture

Assigned: andregp » Unassigned
Status: Active » Needs review
StatusFileSize
new7.65 KB

Changed the order of parameter on the function views_php_form_element() (on views_php.module) and then changed all calls to this function on the other files accordingly.

Status: Needs review » Needs work

The last submitted patch, 4: 3254385-4.patch, failed testing. View results

andregp’s picture

Status: Needs work » Needs review
liam morland’s picture

Version: 7.x-1.0 » 7.x-1.x-dev
Status: Needs review » Needs work
Issue tags: +PHP 8.0

Thanks for the patch.

Changing the order of the parameters would break any code that uses this. The correct fix is to remove the default value from any parameter that is followed by a parameter without a default value.

Please put the fix into an issue fork.

andregp’s picture

Hi Lian, I made the change as you asked for, added on a issue fork, and made a merge request.

andregp’s picture

Status: Needs work » Needs review

  • andregp committed 3921d99 on 7.x-1.x
    Issue #3254385: Removed default value of second parameter of...
liam morland’s picture

Status: Needs review » Fixed

Thanks!

Status: Fixed » Closed (fixed)

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