Problem/Motivation

When switching my site to run on PHP 8, I get the following error:

Deprecated: Required parameter $form_name follows optional parameter $buttons in /home/user/www/sites/all/modules/path_metatags/path_metatags_ui/path_metatags_ui.module on line 824

This link explains how this was deprecated:
https://php.watch/versions/8.0/deprecate-required-param-after-optional

Steps to reproduce

Upgrade to PHP 8.
Create a path metatag, and visit the page.

Proposed resolution

Given the function signature:
_path_metatags_ui_form_attach_buttons(&$form, $buttons = array(), $form_name)
I believe the intention of array() was to indicate an expected type.
If that's true, then the fix is to write the parameter as array $buttons.

Comments

hargobind created an issue. See original summary.

hargobind’s picture

Status: Active » Needs review
StatusFileSize
new803 bytes

Attached is a simple patch to fix this.