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.
field_image_browser field is not uninstalled when uninstalling Entity Browser example module.
If you try to install the module again you get an error:
Unable to install Entity Browser example, field.storage.node.field_image_browser already exists in active configuration.
Comment | File | Size | Author |
---|---|---|---|
#29 | over_ajax without patch.png | 74.76 KB | kenyoOwen |
#29 | image_browser without patch.png | 124.99 KB | kenyoOwen |
#29 | uninstall result without patch.png | 27.83 KB | kenyoOwen |
#29 | over_ajax with patch.png | 84.59 KB | kenyoOwen |
#29 | image_browser with patch.png | 113.61 KB | kenyoOwen |
Comments
Comment #2
MarkoT91 CreditAttribution: MarkoT91 at Develomon for FFW commentedComment #3
alex_optimComment #4
alex_optimRenamed folder and added one configuration.
Comment #5
slashrsm CreditAttribution: slashrsm at MD Systems GmbH commentedPlease create a patch that shows renames instead of removes and adds.
I am not sure if we want to do this. This view mode is already shipped by the node module.
Comment #6
alex_optimComment #7
alex_optimComment #8
alex_optimComment #10
slashrsm CreditAttribution: slashrsm at MD Systems GmbH commentedLooked into this a bit more. The attached patch doesn't fix the actual problem; rather it avoids it on the second install. The problem is that the field isn't removed on uninstall. Attached patch ensures it is.
It would be also nice to add an automated test that would cover this case.
Comment #11
alex_optimComment #12
SocialNicheGuru CreditAttribution: SocialNicheGuru commentedI enabled entity_browser_example.
I disabled it
then I tried to disable entity_browser.
drush pm-uninstall entity_browser -y
The following extensions will be uninstalled: entity_browser
Do you really want to continue? (y/n): y
Drupal\Core\Field\FieldException: Attempt to create a field field_files that does not exist on entity type node. in [error]
drupal-8.4.2/html/core/modules/field/src/Entity/FieldConfig.php:293
drush cr did not help
This patch is necessary.
I went back and re-installed entity_browser_example and then uninstalled it and then uninstalled entity_browser.
It worked.
Otherwise I get this error when trying to uninstall entity_browser (2.x)
Comment #13
Venkatesh Rajan.J CreditAttribution: Venkatesh Rajan.J as a volunteer and at Drupal Partners commentedComment #14
Venkatesh Rajan.J CreditAttribution: Venkatesh Rajan.J as a volunteer and at Drupal Partners commented#10 did not work for me too. The field_image_browser field is not removed even after applying the patch. Errors are thrown when we try to reinstall entity browser example module. Refer the attachment
Comment #15
Venkatesh Rajan.J CreditAttribution: Venkatesh Rajan.J as a volunteer and at Drupal Partners commentedComment #16
dakku CreditAttribution: dakku commentedI recenetly had the same issue on https://www.drupal.org/project/media_entity_flickr:
What I implemented instead is something like:
Comment #17
Ivan Berezhnov CreditAttribution: Ivan Berezhnov as a volunteer and at Drupal Ukraine Community for Levi9 commentedComment #18
guilhermevp CreditAttribution: guilhermevp at CI&T commentedCreated a hook to remove conflicting fields.
Comment #19
Dave ReidShould this go in entity_browser_example.install instead of entity_browser.install so that it actually gets run when the entity_browser_example module is uninstalled?
Comment #20
guilhermevp CreditAttribution: guilhermevp at CI&T commentedEdited.
Comment #21
guilhermevp CreditAttribution: guilhermevp at CI&T commentedComment #22
guilhermevp CreditAttribution: guilhermevp at CI&T commentedSending patch addressing #19.
Comment #23
rukayya CreditAttribution: rukayya at QED42 for Drupal Association commentedComment #24
rukayya CreditAttribution: rukayya at QED42 for Drupal Association commented#22 working fine for me.
Comment #25
BerdirDeleting field config with low-level config API is wrong and will break stuff.
The correct way to do it is to add an explicit config dependency on the module to those config files like most config files already have.
Comment #26
jmizarela CreditAttribution: jmizarela at CI&T commentedI'll try to make something like patch #10 work, considering #19 and following advice from #25.
Comment #27
jmizarela CreditAttribution: jmizarela at CI&T commentedPatch adds both field storage config deletes on uninstall, for field_files_over_ajax and field_image_browser.
You can check it that it now shows on "Configuration deletions" when you "Confirm the uninstallation" like follows:
...
Field storage
...
This patch prevents the problem, it doesn't fix it for people who already have it... if that is your case, just delete the configs manually.
So, for reviewing/testing, PLEASE MAKE SURE you are doing it from a FRESH entity_browser install or that you manually deleted the configs that weren't deleted on the entity_browser_example uninstallation.
I don't think it actually needs testing besides manual testing, but I'd love to learn why that is an incorrect assumption.
Cheers!
Comment #28
kenyoOwen CreditAttribution: kenyoOwen at Promet Source commentedHi jmizarela,
I'm new to this module and applied patch #27 to the Entity Browser against 8.x-1.x-dev and I can't see the node.field_files_over_ajax
node.field_image_browser even with the patch.
Please see screenshot attached.
Thank You.
Comment #29
kenyoOwen CreditAttribution: kenyoOwen at Promet Source commented