Undefined index type error in media_form_field_ui_field_edit_form_alter()

Created on 2 April 2020, about 5 years ago
Updated 17 January 2023, over 2 years ago

An error is displayed when editing an entity reference field for the Commerce Coupon module:

Notice: Undefined index: type in media_form_field_ui_field_edit_form_alter() (line 375 of /sites/all/modules/media/media.module).

This is due to $form['instance']['widget']['type'] not being defined for the default coupon field.

I've included a patch for fixing this in the Media module, but can also understand if the position is this really should be defined in Commerce Coupon. I'm not really sure why they chose to create the entity field without defining a type, other than it wasn't really needed.

See attached, thanks.

πŸ› Bug report
Status

Fixed

Version

2.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States ron_s

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