Include module version in info file for module, w/out causes issue with other modules like geocoder

Created on 16 May 2023, about 1 year ago
Updated 28 October 2023, 8 months ago

Was doing some updating and found after updating geofield I could no-longer run the database update script 'at update.php' or with 'drush updatedb'.

This is the error notice:
"Unresolved dependency Geofield (Version >=2.x required) Geocoder requires this module and version. Currently using Geofield version."

- The notice wasn't listing a current version for geofield.

Upon checking geofield.info there was no version information listed like: version = 7.x-2.5

- so I added it, and could then successfully run database update.

Not sure if that was accidentally excluded, or removed for some reason - but figured I'd at least report it should anyone else run into this.

πŸ’¬ Support request
Status

Fixed

Version

2.5

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States sidgrafix

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

Comments & Activities

  • Issue created by @sidgrafix
  • πŸ‡ΈπŸ‡°Slovakia poker10

    This version info is automatically added by Drupal.org packaging script when the release archives are created. I am looking at the 7.x-2.5 release here: https://www.drupal.org/project/geofield/releases/7.x-2.5 β†’ and I see the version info in the .info file, if I download the archive:

    ; Information added by Drupal.org packaging script on 2023-05-13
    version = "7.x-2.5"
    core = "7.x"
    project = "geofield"
    datestamp = "1683999479"
    

    How did you download the 7.x-2.5 for this updating (which method)?

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

    @poker10

    I use composer, and can confirm the version wasn't included (then in ssh I just cd'd to the modules directory and used nano to view the info file). I didn't download a zip, so never inspected the info file that way.. Perhaps the problem is with package registry that composer pulls from?

    Which makes sense now that I think about it. I was running Geofield 2.4 prior and didn't have an issue with geocoder but after composer require 'drupal/geofield:^2.5' and got the error I initially tried to downgrade to goefield 2.4 and still received the error - meaning the version was also missing from that version even tho it existed prior to update (originally in 2.4).

    So if that makes sense, and is happening, it currently means anything being installed/required by composer isn't including version in info file (at least for geofield and Drupal 7)

    Now I need to check other modules recently updated with composer to make sure it's not happening for all Drupal 7 modules required by composer... (I won't be in office for a.couple.hours yet, but will check first thing when I get there and update this..

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

    OK, so this is really strange!!!

    One of the other modules I updated yesterday as well was metatag (again using composer). If I inspect the module via shell there is no section: Information added by Drupal.org packaging script on 2023-05-12 at the end of the info file like there is if I download the zip package and inspect the file with an editor which does in-fact include version =..

    So I double checked geofield module info file again in shell and it too doesn't have a "Information added by Drupal..." and again if download the zip package the info file does.

    I'm thinking this has to be an issue with the packages composer is getting and it appears to affect all Drupal 7 contrib modules!
    - I checked some other, it looks like this may have been happening for a while. Modules that haven't had updates for long while all have the "Information added by Drupal..." section and appears more recent updated ones do not!

    So...I'm wondering is this a composer problem/bug or a drupal package handling problem for drupal 7? As this appears to have been going on for at least a couple weeks to months...

    Also ran some additional test.. If I downgrade an older module (that upon prior inspection does have Drupal package information) both the downgraded modules info file does not have Drupal package information or when switching back to the latest version of the module using composer require.

    Composer Version is 2.1.14

    My composer.json uses: (the only setup listed that is suppose to work for Drupal 7)
    name: drupal-composer/drupal-project
    repositories url: https://packages.drupal.org/7
    conflict - drupal/core: 8.*

    And up till now (the particular setup this is on has used the same composer.json file for more than 7 years) has never been a problem.

    That said this doesn't appear to be related to any given module as it appears to be affecting any module currently installed or updated with composer for drupal 7.

    @poker10 - I'm sure there is a better place for this to be posted, if you know (point me in the right direction)? Got to get some work done right now - but next chance I have if I haven't heard anything or found an open issue elsewhere regarding this I will file one against core 7.

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

    Found the problem...

    Will document just incase anyone else runs into this!

    Not sure when (had to be a while ago) unless the original composer.json project file for drupal 7 had it. Which thinking about it I think I may have made the addition at some point when I was investigating options to upgrade this particular drupal 7 website to Drupal 9 (10 was beta still) - anyway in my composer.json file in the "config" section I had

           },
           "preferred-install": "source"
    }, 

    That was the only difference I had in comparison to the default drupal-composer/drupal-project found at: https://github.com/drupal-composer/drupal-project/blob/7.x/composer.json

    Which led me to this: https://www.drupal.org/project/drupalci_testbot/issues/2971824 β†’
    "composer install --prefer-source for contrib projects means versions are missing in info files"

    and also this: https://www.drupal.org/project/jsonapi_boost/issues/3260601 β†’

    One thing to note, removing "preferred-install" from composer.json did not fully fix the problem! Any module downloaded from source, even if downgrade and then upgrade to latest using composer require still provided the package from source, I'm assuming because of the composer.lock file.

    So to fix that just composer remove the module without package information provided by Drupal.org and the run composer require latest or version needed and it will then install with package information in the info file.

    ...just crazy, dohhh... Hope I did cause any alarms for anyone as this is likely a rare occurrence - apologies if I did.

  • πŸ‡ΈπŸ‡°Slovakia poker10

    Thanks for the info and great explanation @sidgrafix!

  • Status changed to Fixed 8 months ago
  • πŸ‡ΈπŸ‡°Slovakia poker10
  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.69.0 2024