Upgraded 1.x sites fail w/ fatal error on contact forms due to missing $component['settings']['title']

Created on 10 June 2024, 6 months ago
Updated 27 June 2024, 6 months ago

Problem/Motivation

There is a bug with this issue: https://www.drupal.org/project/email_contact/issues/3310269 β†’ Title will never exist for any site that has had 1.x installed on it. So either this is missing an update hook or the logic needs to check for the existence of title before attempting to trim() it as seen on line 136 of 2.0.5:

if ($title = trim($component['settings']['title'])) {
return $title;
}

Sites upgraded from 1.x will fail to load any page with a contact form on it with this error:

TypeError: trim(): Argument #1 ($string) must be of type string, null given in trim() (line 136 of modules/contrib/email_contact/src/Controller/ContactController.php).

Steps to reproduce

Proposed resolution

Add update hook or add logic to check for missing title fields.

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Fixed

Version

2.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States crystaldawn

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

Comments & Activities

Production build 0.71.5 2024