Just noticed that there's an obvious error on my site when trying change an embedded asset in the WYSIWYG (CKEditor) using the context buttons. The error I get is:

Notice: Undefined index: #language in _assets_clean_fields() (line 407 of asset/includes/asset.admin.inc).
Notice: Undefined index: in _assets_clean_fields() (line 407 of asset/includes/asset.admin.inc).
Warning: Invalid argument supplied for foreach() in element_children() (line 6392 of includes/common.inc).

I have a fix for it which I'll post here shortly.

Comments

chromix’s picture

StatusFileSize
new714 bytes
chromix’s picture

Status: Active » Needs review

Works for me, so switching to needs review.

samvel’s picture

Hi Thomas,

Please specify what fields have your asset type? On clean drupal and on my other projects i haven't this error. $form[$key]['#language'] always filled.

IRuslan’s picture

Status: Needs review » Postponed (maintainer needs more info)
vtkachenko’s picture

Priority: Normal » Major
Status: Postponed (maintainer needs more info) » Needs review
StatusFileSize
new2.04 KB

This issue happens when text field is multiple. Please revise my patch.

mattew’s picture

I think we have 3 different fixes here, because for me I get this error One of the $form[$key] item is a fieldset...
So here is my patch to test if the #type is a 'container', applying on 7.x-1.0-beta4+26-dev

mattew’s picture

StatusFileSize
new718 bytes

It seems that this error could also occur when the form contain a fieldset, see patch #7 to fix that.

fafnirical’s picture

Status: Needs review » Needs work

Patches need re-rolling.

fafnirical’s picture

Status: Needs work » Needs review
StatusFileSize
new858 bytes

Combined #1 and #7 in my re-roll. Together, they appear to solve the issue.

artemboiko’s picture

StatusFileSize
new889 bytes

Hi there.

I worked with some problem related to this issue and I have made new patch for this.
Please check

  • IRuslan committed 963a3e8 on 7.x-1.x
    Improve override form and fix some issues like #2216463
    
IRuslan’s picture

Status: Needs review » Fixed

Guys, thanks for the report.
The problem was not so obvious and leads to changes of most part of override logic, which I pushed to dev.
Now multi-fields also supported for override.

IRuslan’s picture

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.