Modules not updating with composer

Created on 5 August 2023, over 1 year ago
Updated 9 March 2024, 9 months ago

Drupal 10.1.2

Updating modules with composer goes along apparently ok, but "reports/updates" still reports non-updated module...

Steps to reproduce

I just did this with composer:

composer require 'drupal/visitors:^2.16'
./composer.json has been updated
Running composer update drupal/visitors
Loading composer repositories with package information
Updating dependencies
Lock file operations: 0 installs, 1 update, 0 removals
  - Upgrading drupal/visitors (2.15.0 => 2.16.0)
Writing lock file
Installing dependencies from lock file (including require-dev)
Package operations: 0 installs, 1 update, 0 removals
  - Downloading drupal/visitors (2.16.0)
  - Upgrading drupal/visitors (2.15.0 => 2.16.0): Extracting archive
Generating autoload files
Hardening vendor directory with .htaccess and web.config files.
44 packages you are using are looking for funding.
Use the `composer fund` command to find out more!
Cleaning installed packages.
Info from https://repo.packagist.org: #StandWithUkraine
No security vulnerability advisories found

Then I went through "update.php" just in case, then clear cache...
Returning to "reports/updates" page I still see:

I report this as a Drupal issue because is the second module it happens to me with... please check: https://www.drupal.org/project/protected_forms/issues/3379062 🐛 Module not updating Closed: duplicate

💬 Support request
Status

Closed: outdated

Version

10.0

Component
Composer 

Last updated 1 day ago

No maintainer
Created by

🇨🇱Chile Andrés Chandía

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

Comments & Activities

  • Issue created by @Andrés Chandía
  • Status changed to Postponed: needs info over 1 year ago
  • This is not a bug but rather usually something on your end. I have seen:

    • Opcache bugs and misconfigurations. Restarting the web server will reveal this one in some cases.
    • Site owners not allowing Composer plug-ins to run, sometimes resulting in two instances of a module.
    • Other…

    You have to check the module’s info.yml file in its expected location in the first place in a situation like this.

  • 🇨🇱Chile Andrés Chandía

    Thanks for your quick answer...
    I restarted the web server, then just in case, the whole server... and nothing...
    In the point "not allowing the Composer plug-ins to run": how, if I recently upgraded from 9 to 10 with composer and all went well?
    And about the module's info.yum in expected location... well, all modules I've got are in "/drupalroot/modules/"

    Sorry for my ignorance, could you please clarify a little more so I am able to follow you...
    thanks again!

  • What is the version of the module in its info.yml file? What is the precise version of PHP?

    I should have first asked to see the composer.json file before offering help. Let’s see that please.

  • 🇨🇱Chile Andrés Chandía

    Ok, thanks again...
    PHP Version 8.2.8
    I composer.json I've got, I think this is what you're requiring:

    require": {
            "composer/installers": "^2.0",
            "drupal/aggregator": "^2.0",
            "drupal/captcha": "2.0.4",
            "drupal/clipboardjs": "^2.0",
            "drupal/composer_deploy": "^1.7",
            "drupal/core-composer-scaffold": "^10.1.1",
            "drupal/core-project-message": "^10.1.1",
            "drupal/core-recommended": "^10.1.1",
            "drupal/core-vendor-hardening": "^10.1.1",
            "drupal/csv_serialization": "^3.0",
            "drupal/protected_forms": "2.0.3",
            "drupal/visitors": "^2.16",
            "drupal/w3css_paragraphs": "^1.0"
    },

    and info.yml files of the affected modules says:
    core_version_requirement: ">=8"
    version: '2.0.2'
    project: 'protected_forms'

    core_version_requirement: ^8 || ^9 || ^10
    version: '8.x-2.15'
    project: 'visitors'

  • 🇨🇱Chile Andrés Chandía

    I had to update two other modules: captcha and taxonomy_manager...
    All went well updating captcha with composer while with taxonomy_manager persists the problem I have reported.

  • Status changed to Closed: outdated about 1 year ago
  • 🇨🇱Chile Andrés Chandía

    Hi there, I just have discovered why, at least in my case, modules don't update with composer...

    My Drupal installation is a manual one where modules are located directly inside modules/ directory, on composer updating, files of updating modules go to /modules/contrib/ directory.

    Instead of uninstalling and reinstalling modules which would take me a while, I have created hard links instead. That solves my problem...
    I hope this helps

Production build 0.71.5 2024