Notices from Eat::checkIfExists b/c titles in forms are assumed

Created on 24 February 2021, about 4 years ago
Updated 4 March 2025, about 1 month ago

Problem/Motivation

Right now eat_form_submit assumes a value for title is set on forms.
If it isn't, then the following notice will be thrown.

Notice: Trying to access array offset on value of type null in Drupal\eat\Eat::checkIfExists() (line 152 of /app/web/modules/contrib/eat/src/Eat.php)

Steps to reproduce

Alter a form so that a title isn't an option (because it is being set elsewhere).

Proposed resolution

https://git.drupalcode.org/project/eat/-/blob/3.x/eat.module#L67
https://git.drupalcode.org/project/eat/-/blob/3.x/src/Eat.php#L151


$eat_exist_tid = '';
if (!empty($title)) {
$eat_exist_tid = Eat::checkIfExists($title);
}

Remaining tasks

Create a patch/PR

User interface changes

None.

API changes

None.

Data model changes

None.

πŸ› Bug report
Status

Active

Version

3.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States matt_paz

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

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024