Support from Acquia helps fund testing for Drupal Acquia logo

Comments

oenie’s picture

Issue tags: -#amsterdam2014 +Amsterdam2014

fixing the amsterdam sprint tag to amsterdam2014

swentel’s picture

Confirmed - though this was related to #2358409: image_image field element is processed 2 times but it's not

Vj’s picture

Status: Active » Needs review
FileSize
1.14 KB

Error shows twice because of the duplicate id generated template_preprocess_file_widget, template_preprocess_file_widget_multiple.

Added a patch to fix this issue.

jlcerrada’s picture

Status: Needs review » Reviewed & tested by the community

I've tested the patch provided by Vj in the comment #3 and it fixes the double error.

Wim Leers’s picture

Status: Reviewed & tested by the community » Needs work

There's commented code in this patch. Please fix that.

Vj’s picture

Removed commented lines. Let me know if any other changes need to be done.

Vj’s picture

Status: Needs work » Needs review
Wim Leers’s picture

+++ b/core/modules/file/file.field.inc
@@ -27,6 +27,7 @@ function template_preprocess_file_widget(&$variables) {
+  unset($element['#prefix'], $element['#suffix']);

@@ -43,6 +44,7 @@ function template_preprocess_file_widget(&$variables) {
+  unset($element['#prefix'], $element['#suffix']);

I doubt this is the correct solution. Or at least, this'd be one of the weirdest bugfixes I've ever seen :)

Can you explain why this solves the problem, and why you think this is the correct solution?

Vj’s picture

File field has id (edit-field-image-ajax-wrapper) twice. This is the reason its showing double errors. So removed id by unset prefix and suffix.

I am first time trying to use drupal 8 so just wanted to contribute to fix issue :)

Vj’s picture

@Wim can you please guide me to correct solution ???

nitishchopra’s picture

FileSize
136.71 KB

Patch applied successfully, But the double error still exists when we try to upload wrong file format image.please find attached screen shot.

Wim Leers’s picture

This almost sounds like the AJAX system is subtly broken?

Vj’s picture

After bit debugging found \drupal\core\lib\Drupal\Core\Render\Renderer.php::doRender function called twice.

Added a if condition for render_children and issue fixed.

mondrake’s picture

Mile23’s picture

Status: Needs review » Needs work
Issue tags: +Needs reroll

Needs reroll, and is this really a duplicate?

visabhishek’s picture

Status: Needs work » Needs review
FileSize
954 bytes

patch Re-rolled.

gauravjeet’s picture

Issue summary: View changes
Issue tags: -Needs reroll
FileSize
105.7 KB

Looks like this issue is fixed elsewhere in the code, without applying the given patch I tested it with a latest code pull. I do not see double errors. screenshot attached. Removed Needs Reroll Tag

gauravjeet’s picture

Status: Needs review » Reviewed & tested by the community

+RTBC

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 16: file-file_upload_gives_double_error-2349835-16.patch, failed testing.

visabhishek’s picture

Status: Needs work » Needs review
Issue tags: -Amsterdam2014

Dont know why tests failed..

amateescu’s picture

Status: Needs review » Closed (duplicate)

Tested the patch from #2346893-98: Duplicate AJAX wrapper around a file field and it fixes the problem reported here, so marking this one as a duplicate.