Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
1. Upload image or file to image/file field
2. Install file_entity
3. Edit the image and save
Unexpected result:
PluginNotFoundException: The "entity:file:undefined" plugin does not exist. in Drupal\Core\Plugin\DefaultPluginManager->doGetDefinition()
This happens through validation.
Proposed resolution
Determine the bundle at some point before validation.
Remaining tasks
User interface changes
API changes
Data model changes
Comment | File | Size | Author |
---|---|---|---|
#11 | pluginnotfoundexception-2712863-11.patch | 2.81 KB | thenchev |
#11 | interdiff-2712863-11.txt | 1.69 KB | thenchev |
#8 | interdiff-2712863-8.txt | 3.73 KB | thenchev |
#8 | pluginnotfoundexception-2712863-8.patch | 3.5 KB | thenchev |
#4 | pluginnotfoundexception-2712863-4.patch | 1.95 KB | thenchev |
Comments
Comment #2
BerdirThis should only happen while the initial convert queue is running. So not a huge problem I think. We don't want to make the special undefined bundle available I think, maybe just check and convert when editing?
Comment #3
ArlaAh, didn't know about the convert queue. I see now that there's a dsm in hook_install about that. I guess there is nothing to do here then :)
I do see a point in keeping that queue the only way to convert the entities. But yes, this could help.
Comment #4
thenchev CreditAttribution: thenchev at MD Systems GmbH for Acquia commentedAdded the check to the file_entity_file_load() not sure if there is a more appropriate place. Also some tests.
Comment #7
slashrsm CreditAttribution: slashrsm at MD Systems GmbH for Acquia commentedLet's solve this on the form class (possibly in prepareEntity()).
Comment #8
thenchev CreditAttribution: thenchev at MD Systems GmbH for Acquia commentedMoved the check to the form classes. I have one problem with testing the inline-edit modal. I need to simulate an ajax request and tried drupalPost and drupalPostAjaxForm but probubbly missing the correct values. Will look more into this...
Comment #11
thenchev CreditAttribution: thenchev at MD Systems GmbH for Acquia commentedDid some cleanup and removed the test for the inline form since we inherit the fix from the fileEditForm testing one should be enough to cover both.
Comment #12
slashrsm CreditAttribution: slashrsm at MD Systems GmbH for Acquia commentedCommitted. Reworded this comment along the way: