Problem/Motivation

Attempting to update to 2.0.13 with Drupal 10.3.2.

composer outdated shows

drupal/taxonomy_manager          2.0.12 2.0.13 This module provides a powerful interface for managing taxonomies.

but it does not update on composer update.

composer why-not drupal/taxonomy_manager 2.0.13 shows
There is no installed package depending on "drupal/taxonomy_manager" in versions not matching 2.0.13

composer require "drupal/taxomony_manager:2.0.13" --dry-run shows

./composer.json has been updated
Running composer update drupal/taxomony_manager
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/taxomony_manager, it could not be found in any version, there may be a typo in the package name.

Potential causes:
 - A typo in the package name
 - The package is not available in a stable-enough version according to your minimum-stability setting
   see <https://getcomposer.org/doc/04-schema.md#minimum-stability> for more details.
 - It's a private package and you forgot to add a custom repository to find it

Read <https://getcomposer.org/doc/articles/troubleshooting.md> for further common problems.

Installation failed, reverting ./composer.json and ./composer.lock to their original content.
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

bunthorne created an issue. See original summary.

jurgenhaas’s picture

Priority: Normal » Major

Hitting the same issue. Declaring a dependency in composer.json which doesn't exist in a package manager is NOT a great idea.

The repository in this module's composer.json is not recognized by the root project. So, with the change introduced in #3449481: Install jquery.fancytree via Composer instead of CDN this module can only installed or updated when the root composer.json gets updated manually.

Please don't do that!

If you want to do this like the famous webform module, then you should introduce a separate composer.taxman.json or something similar, and declare the extra dependency and repository there. The readme should then explain how to make this work, like webform has done it as well.

nagy.balint’s picture

Priority: Major » Critical

I can confirm. The latest version is not installable by composer:

It is likely a critical issue.

drupal/taxonomy_manager 2.0.13 requires jquery/fancytree ^2.38 -> could not be found in any version, there may be a typo in the package name.

maxilein’s picture

Same here:

composer require 'drupal/taxonomy_manager:2.0.x-dev@dev'
./composer.json has been updated
Running composer update drupal/taxonomy_manager
Gathering patches for root package.
...
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - drupal/taxonomy_manager dev-2.0.x requires jquery/fancytree ^2.38 -> could not be found in any version, there may be a typo in the package name.
    - drupal/taxonomy_manager 2.0.x-dev is an alias of drupal/taxonomy_manager dev-2.0.x and thus requires it to be installed too.
    - Root composer.json requires drupal/taxonomy_manager 2.0.x-dev@dev -> satisfiable by drupal/taxonomy_manager[2.0.x-dev (alias of dev-2.0.x)].

Potential causes:
 - A typo in the package name
 - The package is not available in a stable-enough version according to your minimum-stability setting
   see <https://getcomposer.org/doc/04-schema.md#minimum-stability> for more details.
 - It's a private package and you forgot to add a custom repository to find it

Read <https://getcomposer.org/doc/articles/troubleshooting.md> for further common problems.
piratawww’s picture

Same here:

`composer require "drupal/taxonomy_manager:2.0.13" --dry-run`

./composer.json has been updated
Running composer update drupal/taxonomy_manager
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/taxonomy_manager 2.0.13 -> satisfiable by drupal/taxonomy_manager[2.0.13].
    - drupal/taxonomy_manager 2.0.13 requires jquery/fancytree ^2.38 -> could not be found in any version, there may be a typo in the package name.
pahles’s picture

Same for me!

pgrandeg’s picture

The same here. The problem is the package repository declaration is in the same commit has the dependency requirement, and composer is not able to read that.
As a workaround, you can implement this in your project's composer.json file "repositories" section:

"repositories": [
...
        {
            "type": "package",
            "package": {
                "name": "jquery/fancytree",
                "version": "2.38.3",
                "type": "drupal-library",
                "extra": {
                "installer-name": "jquery.fancytree"
                },
                "dist": {
                "url": "https://github.com/mar10/fancytree/archive/refs/tags/v2.38.3.zip",
                "type": "zip"
                },
                "license": "MIT"
            }
        },
...
]

And after that, you will be able to update as usual:

$ composer update drupal/taxonomy_manager:2.0.13 -W
Gathering patches for root package.
Loading composer repositories with package information
Updating dependencies                                 
Lock file operations: 1 install, 1 update, 0 removals
  - Upgrading drupal/taxonomy_manager (2.0.12 => 2.0.13)
  - Locking jquery/fancytree (2.38.3)
Writing lock file
Installing dependencies from lock file (including require-dev)
Package operations: 1 install, 1 update, 0 removals
  - Downloading jquery/fancytree (2.38.3)
  - Downloading drupal/taxonomy_manager (2.0.13)
Gathering patches for root package.
Gathering patches for dependencies. This might take a minute.
  - Installing jquery/fancytree (2.38.3): Extracting archive
  - Upgrading drupal/taxonomy_manager (2.0.12 => 2.0.13): Extracting archive
Generating autoload files
119 packages you are using are looking for funding.
Use the `composer fund` command to find out more!
phpstan/extension-installer: Extensions installed
No security vulnerability advisories found.

I hope it helps :)

alphex’s picture

Confirming that #8 solves the issue.

pahles’s picture

That might work but it is not preferred. I should not have to change my projects composer.json.

la558’s picture

thanks @pgrandeg for you suggestion in #8

Although that made the trick and I was able to upgrade taxonomy_manger to 2.0.13

composer update drupal/taxonomy_manager  --with-dependencies

Gathering patches for root package.
Loading composer repositories with package information
Updating dependencies
Lock file operations: 1 install, 1 update, 0 removals
  - Upgrading drupal/taxonomy_manager (2.0.12 => 2.0.13)
  - Locking jquery/fancytree (2.38.3)
Writing lock file
Installing dependencies from lock file (including require-dev)
Package operations: 1 install, 1 update, 0 removals
  - Downloading jquery/fancytree (2.38.3)
  - Downloading drupal/taxonomy_manager (2.0.13)
Gathering patches for root package.
Gathering patches for dependencies. This might take a minute.
  - Installing jquery/fancytree (2.38.3): Extracting archive
  - Upgrading drupal/taxonomy_manager (2.0.12 => 2.0.13): Extracting archive
Generating autoload files
59 packages you are using are looking for funding.
Use the `composer fund` command to find out more!
No security vulnerability advisories found.

when attempting to access any of the vocabularies in the "taxonomy manager' page, the site broke
"The website encountered an unexpected error. Try again later."

Watch dog shows:

 php    Error      ArgumentCountError: Too few arguments to function Drupal\taxonomy_manager\TaxonomyManagerHelper::__construct(), 4 passed in  
                                        /path/to/drupal/site/web/core/lib/Drupal/Component/D  

So I had to roll back the recommended changes.

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

vladimiraus’s picture

Version: 2.0.13 » 2.0.x-dev
Issue summary: View changes
Status: Active » Needs review
jannakha’s picture

Status: Needs review » Reviewed & tested by the community

thanks for the fix

vladimiraus’s picture

Status: Reviewed & tested by the community » Fixed
torfj’s picture

After updating the module to version 2.0.14, it can now be installed without modifying the root composer file. However, the fancytree is not displaying. I had to manually include the fancytree package in the composer file, as suggested here. It’s confusing that the fancytree package is listed as ‘suggested’ in composer when it is actually required for the module.

rajab natshah’s picture

vladimiraus’s picture

@torfj yes, that was the way to make the release work.
You need to add library manually.

I'll update documentation and will checkout @rajab natshah task suggestion.

nagy.balint’s picture

What I did last time is that I left the CDN in the libraries.yml file, but then implemented a library_info_alter to check if the library is installed via composer and then use that instead.

This way the module works out of the box when installed, but also works if the library is manually installed via the composer repositories section.

Status: Fixed » Closed (fixed)

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