Duplicate hook name insert_field_widget_single_element_form_alter

Created on 13 December 2023, 11 months ago
Updated 17 December 2023, 11 months ago

Problem/Motivation

Function insert_field_widget_single_element_form_alter() in insert_media sub-module implements hook_field_widget_single_element_form_alter().

As the module name is insert_media, the correct name of the function should be
insert_media_field_widget_single_element_form_alter()

A function of the same name is also in the insert module, and it causes problems. For example, using phpstan will result in a fatal error.

PHP Fatal error:  Cannot redeclare insert_field_widget_single_element_form_alter() (previously declared in /var/www/web/modules/contrib/insert/insert.module:742) in /var/www/web/modules/contrib/insert/modules/insert_media/insert_media.module on line 203

Proposed resolution

Rename insert_field_widget_single_element_form_alter web/modules/contrib/insert/modules/insert_media/insert_media.module
to insert_media_field_widget_single_element_form_alter.

💬 Support request
Status

Closed: duplicate

Version

3.0

Component

Code

Created by

🇨🇿Czech Republic martin_klima

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024