"Undefined index: value" when soft length limit not set

Created on 29 May 2020, about 4 years ago
Updated 27 January 2024, 5 months ago

When creating/editing content which has one or more text fields where a soft length limit is not set, several PHP notices and warnings are generated. e.g:

Notice: Undefined index: value in soft_length_limit_field_widget_form_alter() (line 158 of /app/docroot/modules/contrib/soft_length_limit/soft_length_limit.module)

Notice: Trying to access array offset on value of type null in soft_length_limit_field_widget_form_alter() (line 158 of /app/docroot/modules/contrib/soft_length_limit/soft_length_limit.module)

Warning: array_merge_recursive(): Expected parameter 2 to be an array, null given in soft_length_limit_field_widget_form_alter() (line 158 of /app/docroot/modules/contrib/soft_length_limit/soft_length_limit.module)

I have attached a simple patch to fix.

πŸ› Bug report
Status

Closed: outdated

Version

2.1

Component

Code

Created by

πŸ‡¬πŸ‡§United Kingdom Rijidij

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

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.69.0 2024