Multiple warnings related to form build functions

Created on 11 April 2024, 3 months ago
Updated 25 April 2024, 2 months ago

Problem/Motivation

When we configured an ECK entity to use Inline Entity Form (not related to Anu LMS at all), the form started throwing a bunch of warnings:

Warning: Undefined array key "form_id" in anu_lms_field_group_form_process_build_alter() (line 52 of modules/contrib/anu_lms/anu_lms.module).
Warning: Trying to access array offset on value of type null in anu_lms_field_group_form_process_build_alter() (line 52 of modules/contrib/anu_lms/anu_lms.module).
Warning: Undefined array key "form_id" in anu_lms_field_group_form_process_build_alter() (line 52 of modules/contrib/anu_lms/anu_lms.module).
Warning: Trying to access array offset on value of type null in anu_lms_field_group_form_process_build_alter() (line 52 of modules/contrib/anu_lms/anu_lms.module).
Warning: Undefined array key "form_id" in anu_lms_assessments_field_group_form_process_build_alter() (line 147 of modules/contrib/anu_lms/modules/anu_lms_assessments/anu_lms_assessments.module).
Warning: Trying to access array offset on value of type null in anu_lms_assessments_field_group_form_process_build_alter() (line 147 of modules/contrib/anu_lms/modules/anu_lms_assessments/anu_lms_assessments.module).

Looks like a some checks are missing.

Steps to reproduce

- Create a custom entity using ECK module
- Add a ECK entity to any form using Inline Entity Form module
- You'll see the warnings above

Proposed resolution

Add missing checks in place.

User interface changes

No.

API changes

No.

Data model changes

No.

🐛 Bug report
Status

Fixed

Version

2.0

Component

Code

Created by

🇧🇾Belarus Spleshka UAE

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

Merge Requests

Comments & Activities

Production build 0.69.0 2024