Problem/Motivation

When creating a new Media type entity, the form validation and submit functions use if ($form['source_dependent']['source_configuration']) { to check for the existence of the enclosed value.

This causes an Undefined index error which prevents AJAX from loading the source dependent configuration forms.

Proposed resolution

Use if (array_key_exists('source_configuration', $form['source_dependent'])) { instead.

Remaining tasks

Review

User interface changes

None

API changes

None

Data model changes

None

CommentFileSizeAuthor
#2 media-undefined-index-2932222-1.patch1.35 KBdarvanen

Comments

Darvanen created an issue. See original summary.

darvanen’s picture

Status: Active » Needs review
StatusFileSize
new1.35 KB
chr.fritsch’s picture

Patch looks good.

Would be nice to get a fail patch to visualize the error.
I tried to create one by setting error_reporting(E_ALL); or $this->config('system.logging')->set('error_level', ERROR_REPORTING_DISPLAY_ALL)->save(); in MediaSourceFileTest, but it didn't break.

darvanen’s picture

Status: Needs review » Closed (outdated)

Seems like this is no longer an issue.

darvanen’s picture

Status: Closed (outdated) » Needs work

Oh, I'm an idiot, I had the patch installed on that environment (momentarily confused).

Still trying to figure out why this doesn't present on a vanilla install.

marcoscano’s picture

I believe the fixes from this patch were committed as part of #2932226: Media Type entities don't validate machine name properly.

darvanen’s picture

Status: Needs work » Closed (duplicate)

Ah, similar but different, but they'll definitely do the job, great =)