Problem/Motivation

Installing the module for Drupal 9.4.6 fails with an error:

Problem 1
    - drupal/media[dev-1.x, 1.x-dev] require drupal/core ^8 -> found drupal/core[8.0.0-beta6, ..., 8.9.x-dev] but these were not loaded, likely because it conflicts with another require.
    - drupal/advanced_gutenberg_blocks 1.0.0-beta1 requires drupal/media * -> satisfiable by drupal/media[dev-1.x, 1.x-dev (alias of dev-1.x)].
    - drupal/media 1.x-dev is an alias of drupal/media dev-1.x and thus requires it to be installed too.
    - Root composer.json requires drupal/advanced_gutenberg_blocks ^1.0@beta -> satisfiable by drupal/advanced_gutenberg_blocks[1.0.0-beta1].

Although, when downgrading to Drupal 9.4.3 it works fine.

Steps to reproduce

Install the module using composer:
composer require 'drupal/advanced_gutenberg_blocks:^1.0@beta'

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

hodba created an issue. See original summary.

rajesh bhimani’s picture

Thank you for your feedback. We are looking into it and will try to fix the issue by this weekend.

Have a great weekend and Thank you once again.

mmjvb’s picture

Workaround:

9:43:27 - DrupalComposer/d94 % grep provide composer.json
    "provide": { "drupal/media": "*", "drupal/ckeditor": "*" },
9:43:30 - DrupalComposer/d94

This bug in core was introduced at 9.4.4 when they removed these modules from the replace section. No longer advertising these modules as provided by core makes for these problems. The workaround allows for installation but is not a permanent fix.

You can no longer have a dependency on a module that used to be provided by core. The facade manipulates dependency information declared in the info.yml, provided it uses the recommended format [project]:[module]. It also manipulates the meta information for composer. Couldn't find proper documentation on what it does. Consider what is done wrong, but they insist on keeping it this way.

As removing the requirement is a maintainer of the module activity, recommend the workaround at it can be done by the maintainer of the site.

rajesh bhimani’s picture

Hello hodba,

We have checked by downloading latest version 9.4.6 and it seems to us working fine.
We are not able to replicate issue, More details or steps would help to understand and fix it. if possible provide screenshots/video

FYI: All the dependency are required to work with our module like media library module and gutenberg module.

Also, thanks to mmjvb for providing detail information.

Thank you all for checking and giving feedback about our module.

mmjvb’s picture

Just reproduced:

docker@d946:/var/www$ composer create-project drupal/legacy-project d947l 9.4.7
Creating a "drupal/legacy-project" project at "./d947l"
....
docker@d946:/var/www$ cd d947l
docker@d946:/var/www/d947l$ composer require drupal/advanced_gutenberg_blocks "@beta" --no-update
./composer.json has been updated
docker@d946:/var/www/d947l$ composer update drupal/advanced_gutenberg_blocks
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Root composer.json requires drupal/advanced_gutenberg_blocks @beta -> satisfiable by drupal/advanced_gutenberg_blocks[1.0.0-beta1].
    - drupal/advanced_gutenberg_blocks 1.0.0-beta1 requires drupal/media * -> found drupal/media[dev-1.x, 1.x-dev (alias of dev-1.x)] but it does not match your minimum-stability.

docker@d946:/var/www/d947l$ grep provide composer.json
    "provide": { "drupal/media": "*" },
docker@d946:/var/www/d947l$ composer update drupal/advanced_gutenberg_blocks
Loading composer repositories with package information
Updating dependencies
Lock file operations: 2 installs, 0 updates, 0 removals
  - Locking drupal/advanced_gutenberg_blocks (1.0.0-beta1)
  - Locking drupal/gutenberg (2.5.0)
Writing lock file
Installing dependencies from lock file (including require-dev)
Package operations: 2 installs, 0 updates, 0 removals
  - Downloading drupal/gutenberg (2.5.0)
  - Downloading drupal/advanced_gutenberg_blocks (1.0.0-beta1)
  - Installing drupal/gutenberg (2.5.0): Extracting archive
  - Installing drupal/advanced_gutenberg_blocks (1.0.0-beta1): Extracting archive
Package doctrine/reflection is abandoned, you should avoid using it. Use roave/better-reflection instead.
Package symfony/debug is abandoned, you should avoid using it. Use symfony/error-handler instead.
Generating autoload files
Hardening vendor directory with .htaccess and web.config files.
42 packages you are using are looking for funding.
Use the `composer fund` command to find out more!
Cleaning installed packages.
No security vulnerability advisories found
docker@d946:/var/www/d947l$

Deg made their first commit to this issue’s fork.

deg’s picture

Just reproduced as well. As mentioned by mmjvb, it looks like this is an issue caused by https://www.drupal.org/project/drupal/issues/3292380. I believe removing 'media' and 'media-library' from advanced_gutenberg_blocks.info.yml should resolve the issue. I'm trying to create a PR but having some issues with my localdev setup.

szeidler’s picture

I haven't checked Drupal's Composer facade (the one that transforms info.yml dependencies into composer dependencies, if there is no composer.json in the module). Might it work to prefix the dependency, for example drupal:media?

rajesh bhimani’s picture

Thank you szeidler and mmjvb for your feedback.

We have updated module and added composer.json in the our module.

Issue has been resolved with new latest release beta2.
You can check with this composer require 'drupal/advanced_gutenberg_blocks:^1.0@beta'

rajesh bhimani’s picture

rajesh bhimani’s picture

rajesh bhimani’s picture

Version: 1.0.0-beta1 » 1.0.0-beta2
Assigned: Unassigned » rajesh bhimani
Status: Active » Fixed

Issue is already fixed 12 months ago

Status: Fixed » Closed (fixed)

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