Unable to install due to unmet dependencies

Created on 11 August 2023, over 1 year ago
Updated 11 September 2024, 3 months ago

First of all: the idea of this module is soooo cool. This feature is desperately needed in drupal! Thanks for your efforts!!!

Problem/Motivation

I installed the module with composer and tried to activate it with drush (also via the GUI).
Unfortunately I receive the following error:

Unable to install Ckeditor Media Resize due to unmet dependencies: core.entity_view_display.media.image.cke_media_resize_large (field.field.media.image.field_media_image, media.type.image)

Drupal 9.5.1
PHP 8.1.2 & Postgres Database

πŸ› Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

πŸ‡©πŸ‡ͺGermany AgathaCrystal Potsdam

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @AgathaCrystal
  • Status changed to Postponed: needs info over 1 year ago
  • Hi AgathaCrystal

    I tried to replicate this on a Vanilla Drupal 9.5 and 10 but it's working for me when I install the module via

    $ composer require drupal/ckeditor_media_resize
    $ drush en -y ckeditor_media_resize
    

    and also when I install via UI. Could you please share a screenshot of your module folder? The folder ckeditor_media_resize/config/install would be particulary interesting.

  • πŸ‡ΊπŸ‡ΈUnited States ferminaguilar

    My media type image was not called "image" but called "media_image". So I had updated 4 files in "ckeditor_media_resize\config\install" core.entity_view_display.media.image.cke_media_resize_*.yml (*large, small, medium and xl) dependencies: config:

    Original
    - field.media.image.field_media_image

    - media.type.image

    My modification
    - field.field.media.media_image.field_media_image

    - media.type.media_image

    Once i made the change on all 4 files it started working

  • πŸ‡©πŸ‡ͺGermany rgpublic DΓΌsseldorf πŸ‡©πŸ‡ͺ πŸ‡ͺπŸ‡Ί

    For me it was sth. different still. I'm afraid it won't work reliably this way. Reason:

    /admin/structure/media/manage/image/fields

    Note that the fields here are freely configurable. Including their machine_name. This module should work (or even install) no matter what configuration you have IMHO.

  • πŸ‡΅πŸ‡ΉPortugal jrochate

    Same here:

    the medias image field's names are customised.

    So, I get this on install:

    Unable to install Ckeditor Media Resize due to unmet dependencies: core.entity_view_display.media.image.cke_media_resize_large (field.field.media.image.field_media_image, media.type.image)

  • Status changed to Active about 1 year ago
  • πŸ‡ΊπŸ‡ΈUnited States DamienMcKenna NH, USA

    We need to add some basic test coverage for the basic setup process to make sure it works, then we'll be able to work through edge scenarios.

  • πŸ‡©πŸ‡ͺGermany AgathaCrystal Potsdam

    Sorry for coming back so late - I settled for a different approach and forgot.

    As in #4 & #5 described, I have custom media types and don't even had the media type 'image' in the first place. I think if Drupal is installed in the barebone version, the media type wont get created. My page is running now with D10 and also has the problem (ofc).

  • πŸ‡©πŸ‡ͺGermany Anybody Porta Westfalica

    Same issue here, so I don't think we should see this as edge-case. The module makes assumptions that don't seem to match for several installations.

  • πŸ‡©πŸ‡ͺGermany Anybody Porta Westfalica

    Added an EXAMPLE how to manually fix this for different media image field names! In our case this for example is named field_image. The MR isn't going anywhere, it just shows a manual resolution.

    TBH I have no good idea yet, how this could be solved in general. Perhaps this part of the install config could be moved into optional, so the module still installs, if the dependencies are not met? But then I think we'll see issues about the module not working as expected?

  • πŸ‡©πŸ‡ͺGermany rgpublic DΓΌsseldorf πŸ‡©πŸ‡ͺ πŸ‡ͺπŸ‡Ί

    Well, AFAIU the "problematic" part tries to configure certain things for the existing media library image fields on install. I think this should just be omitted completely and users should instead by instructed to configure things themselves. I haven't even fully understood yet what exactly it is that would so sorely be missing if we just left that stuff out altogether. If we really want to keep this, then, I guess, we can't make it work with a simple static YML file. It's just not flexible enough. We'd have to run PHP code on install that looks for an image field etc. But, as I said, I don't think it's necessary. Just install the module without all that install-o-magic and let users configure their fields as they deem fit.

  • πŸ‡ΈπŸ‡ͺSweden Jochen Wendebaum

    Is there any hint on how to solve this?

    Running latest Drupal 10.2.3, freshly installed, and have the same error.

  • πŸ‡ΊπŸ‡¦Ukraine stomusic Ukraine

    The problem is important, but in any case, the configurations with some unstable dependencies must be placed in the "optional" directory. It would unlock the possibility of using this module with some other fields configuration and as a part of some profile installation

  • Status changed to Fixed 4 months ago
  • πŸ‡ΊπŸ‡ΈUnited States DamienMcKenna NH, USA

    Agreed on making the media view modes & display settings optional so that it won't fail to install if the default "field_media_image" field isn't defined.

    Committed.

    Because this is still in beta, please continue to work on new issues if this needs further refinement, and I'm sure it does.

  • Automatically closed - issue fixed for 2 weeks with no activity.

  • πŸ‡©πŸ‡ͺGermany AgathaCrystal Potsdam

    Thanks for your effort! I tried to install the update but it failed again on the UnmetDependenciesExpetion.php.

    Configuration objects provided by ckeditor_media_resize have unmet dependencies: co
    re.entity_view_display.media.image.cke_media_resize_large (field.field.media.image.field_media_image, media.type.image)

  • πŸ‡ΊπŸ‡ΈUnited States DamienMcKenna NH, USA

    Is that with 1.0.0-beta2?

  • πŸ‡©πŸ‡ͺGermany AgathaCrystal Potsdam

    I'm sorry - I forgot to update to Drupal 10.3 and composer installed the beta1. Its working! :))

  • πŸ‡ΊπŸ‡ΈUnited States DamienMcKenna NH, USA

    Excellent, thank you for confirming!

Production build 0.71.5 2024