Multiple ajax calls returns empty span

Created on 28 August 2018, over 6 years ago
Updated 10 April 2024, 9 months ago

When using an entity reference field and multiple ajax requests are triggered (by clicking more than one buttons having ajax callback). The entity reference form ends up being empty i.e doesnot show any fields. I checked the recent log entries and found the following error:
Notice: Undefined index: #prefix in Drupal\file\Element\ManagedFile::uploadAjaxCallback() (line 196 of docroot/core/modules/file/src/Element/ManagedFile.php) #0

🐛 Bug report
Status

Postponed: needs info

Version

2.0

Component
Ajax 

Last updated about 5 hours ago

Created by

🇮🇳India ameymudras

Live updates comments and jobs are added and updated live.
  • Quick fix

    Very small and simple change. Preferred over Quickfix.

  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

  • Needs issue summary update

    Issue summaries save everyone time if they are kept up-to-date. See Update issue summary task instructions.

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.

  • 🇺🇸United States smustgrave

    If still an issue IS should be updated.

  • 🇺🇸United States DamienMcKenna NH, USA

    Just started seeing this on a site that was upgraded from (I think) 9.3.x to the latest 9.5.x. The error happens when someone is uploading an image through the media library widget on a media reference field on a node; the "Add media" button is clicked, the dialog opens, you click the "Select file" button, pick a file, after it finishes uploading the file the media library's grid of existing images disappears.

  • 🇺🇸United States DamienMcKenna NH, USA

    FWIW we also use DropzoneJS on this site, so it could also be a bug there ( https://www.drupal.org/project/issues/dropzonejs?categories=1&version=al... ). It's made hard to track down because it only shows on our site's production environments, not the non-production environments which are running the same code.

  • 🇺🇸United States dealancer Washington D.C.

    DamienMcKenna, this is exactly the issue which we are experiencing. It's happening on production, we also use DropzoneJS. We use paragraphs and a media field on it.

  • 🇺🇸United States dealancer Washington D.C.

    This is happening for us as well. When user selects a file, upload process is starting, but then form refreshes and no file is shown as uploaded.

  • 🇺🇸United States dealancer Washington D.C.

    I can confirm that this issue is caused by DropzoneJS module since after I have disabled it, images are getting upload with no problems and no error message is shown.

Production build 0.71.5 2024