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
- I had imagemagick module (1.0-alpha6) and Drupal core 8.3.4
- Using Composer, I updated to imagemagick module (2.0) and Drupal core 8.3.5
- I ran the updates and did a cache rebuild
- For image fields I cannot upload images due to this error: Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException: You have requested a non-existent service "file_metadata_manager". in Drupal\Component\DependencyInjection\Container->get() (line 157 of /.../core/lib/Drupal/Component/DependencyInjection/Container.php).
- I had to enable file_mdm module to make it work
Comment | File | Size | Author |
---|---|---|---|
#4 | imagemagick-enable-file_mdm-2895864-4.patch | 386 bytes | mfernea |
Comments
Comment #2
mondrakeThank you for your report. I assume you were using Composer to update the code base, correct?
In the scenario you describe, it looks like we are missing an update function to enable the file_mdm module if it's not enabled already.
The workaround - enabling the file_mdm module manually - should be ok, in the meantime.
Comment #3
mfernea CreditAttribution: mfernea at AmeXio commentedIndeed, I used Composer. The file_mdm module was downloaded, but it was not enabled. If an update hook is the right solution I will write a patch.
Comment #4
mfernea CreditAttribution: mfernea at AmeXio commentedThis is the patch.
Comment #5
mondrakeThanks a lot @mfernea.
Tested the patch following the scenario in the IS - run
composer require drupal/imagemagick:2.x-dev
on top of a codebase with 1.0-alpha6 installed, applied the patch and run Drupal updates -> file_mdm module is enabled.Also tested the patch running Drupal update on a separate scenario where imagemagick 2.0 and file_mdm are already installed -> update runs fine even if the file_mdm module is already enabled.
I'll commit this and create a new release in the next few days if no more reviews.
Comment #7
mondrakeCommitted to 8.x-2.x, thanks