You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
PHP 8 Deprecated function: Optional parameter $input declared before required parameter $form_state is implicitly treated as a required parameter in include_once()
#6005
Open
jenlampton opened this issue
Feb 28, 2023
· 3 comments
I'm running a backdrop site on php 8.1 with deprecation warnings enabled, and I'm seeing a handful of these:
Deprecated function: Optional parameter $input declared before required parameter $form_state is implicitly treated as a required parameter in include_once() (line 1509 of backdrop/docroot/core/includes/bootstrap.inc).
These functions called via bootstrap.inc can be hard to track down...
Searching for $input before $form_state in function definitions returns a set of Form API value callbacks, all from core:
$value_callback($element, $input, $form_state);
Such as:
file_field_widget_value()
file_managed_file_value()
form_type_image_button_value()
form_type_textarea_value()
form_type_textfield_value()
list_boolean_allowed_values_callback()
Should we check all these to make sure that there are no optional items before required?
Steps To Reproduce
To reproduce the behavior:
Go to '...'
Click on '....'
Scroll down to '....'
Actual behavior
PHP warnings about deprecations
Expected behavior
No warnings :)
Additional information
Add any other information that could help, such as:
Backdrop CMS version: 1.24.0
PHP version: 8.1
The text was updated successfully, but these errors were encountered:
Hi @jenlampton. I've checked those functions, but none of of them have an optional $input before $form_state. The culprit may be somewhere else. I'm using Backdrop with PHP 8.1 and am not seeing these messages (we have been fixing several of them in the past). I wonder if perhaps this is happening in a contrib module you have installed?
I'm searching core and several contrib modules using the following regex pattern /\$input = (.*), \$form_state(,|\))/
@jenlampton If you have a copy of the site running locally and have xdebug installed you should be able to view the call stack to see what is firing before these warnings.
Description of the bug
I'm running a backdrop site on php 8.1 with deprecation warnings enabled, and I'm seeing a handful of these:
These functions called via bootstrap.inc can be hard to track down...
Searching for
$input
before$form_state
in function definitions returns a set of Form API value callbacks, all from core:Such as:
file_field_widget_value()
file_managed_file_value()
form_type_image_button_value()
form_type_textarea_value()
form_type_textfield_value()
list_boolean_allowed_values_callback()
Should we check all these to make sure that there are no optional items before required?
Steps To Reproduce
To reproduce the behavior:
Actual behavior
PHP warnings about deprecations
Expected behavior
No warnings :)
Additional information
Add any other information that could help, such as:
The text was updated successfully, but these errors were encountered: