- Issue created by @Supreetam09
- Merge request !40Issue-3511344: EntityBrowser widget FileUpload cancel button clashes with... → (Open) created by Supreetam09
For Image type media entities, when trying to upload a media on the fly using the FileUpload Entity Browser widget, we can see 2 buttons - one Cancel and one Remove.
While, the Cancel button works as expected by default, but when pressed after clicking Remove button (added by Drupal image field widget for managed_file
type fields) - throws error for missing file.
Error: Call to a member function getFileUri() on null in template_preprocess_file_link() (line 1064 of /var/www/html/docroot/core/modules/file/file.module)
The error is to be expected, since Remove action already deleted the temp uploaded file and then Cancel action is again trying to delete the same file, which does not exist anymore - hence a clash.
Click on Cancel button after Remove button.
Since a clash is occurring, the solution I think would be, to not let users use both the buttons. Cancel button works fine, resets the form and also removes the temp file, so the ideal choice would be to disable the functionality of Remove button.
Active
5.0
Code