Problem/Motivation

1. /node/add/article
2. Upload an image in the wysiwyg editor
3. Console error: Uncaught TypeError: Cannot read property 'length' of undefined in Drupal.file.Drupal.file.validateExtension

Because that template, or more specifically template_preprocess_file_managed_file(), adds an id based on #element['id'], which is also added to the actual input element.

Proposed resolution

Add a suffix to the id? Just remove it (what does it even do?)

Speaking of that, what's the point of this template? And why does it exist in an identical version in classy and file?

Remaining tasks

User interface changes

API changes

Comments

idebr’s picture

Berdir’s picture

I don't think so, this is inside the ajax element and the fix there doesn't look related at all. This is already duplicated before an ajax request happens.

idebr’s picture

Berdir’s picture

Thanks yes, that is in fact the bug. I even talked about this with him but he didn't remember :)

Berdir’s picture

Status: Active » Closed (duplicate)