2

I have a project installed by composer, everything working perfectly, except when i run composer install contrib module installed successfully in web/modules/contrib but none of the modules .info.yml contain something like:

# Information added by Drupal.org packaging script on 2016-06-09
version: '8.x-3.0-alpha2'
core: '8.x'
project: 'MODULENAME'
datestamp: 1465505348

Issue is i don't see module needs update in admin/reports/updates
and when i run drush ups i get enter image description here

Or even composer show i get enter image description here

Even on admin/modules i can't see the module version enter image description here Like the following picture from another project enter image description here

And i can't run drush updb throw an error

The Pathauto module is not compatible with the current version of Drupal core. Update the Pathauto module to 8.x-1.6 or later.

Because it check on pathauto version in system_requirements and get the version as null:

$info = \Drupal::service('extension.list.module')->getExtensionInfo('pathauto');
// This is null 
$info['version']

Composer version 1.9.1 .
My composer.json:

{
  "authors": [
    {
      "name": "Author",
      "email": "[email protected]"
    },
    {
      "name": "Author 2",
      "email": "[email protected]"
    }
  ],
  "autoload": {
    "psr-4": {
      "Osinet\\Deploy\\": "scripts/Osinet/"
    },
    "classmap": [
      "scripts/composer/ScriptHandler.php"
    ]
  },

  "config": {
    "discard-changes": true,
    "preferred-install": "source",
    "process-timeout": 3600,
    "secure-http": false,
    "sort-packages": true
  },
  "conflict": {
    "drupal/drupal": "*"
  },
  "description": "Project",
  "extra": {
    "installer-paths": {
      "drush/contrib/{$name}": ["type:drupal-drush"],
      "import": ["type:zend-extra"],
      "web/core": ["type:drupal-core"],
      "web/libraries/{$name}": ["type:drupal-library"],
      "web/modules/contrib/{$name}": ["type:drupal-module"],
      "web/profiles/contrib/{$name}": ["type:drupal-profile"],
      "web/themes/contrib/{$name}": ["type:drupal-theme"]
    },
    "osinet-builder": {
      "params": "settings/params.local.yml",
      "tmp-dir": "tmp"
    },
    "patches": {
      "drupal/media_entity": {
        "Fix broken route remote": "https://www.drupal.org/files/issues/dynamically_define_menu-2831071-17.patch"
      }
    },
    "bin-dir": "bin"
  },
  "license": "GPL-2.0+",
  "minimum-stability": "dev",
  "prefer-stable": false,
  "repositories": [
    {
      "type": "vcs",
      "url": "https://github.com/dawehner/drush_language.git"
    },
    {
      "type": "vcs",
      "url": "https://github.com/kgaut/drupal-potx.git"
    },
    {
      "type": "composer",
      "url": "https://packages.drupal.org/8"
    }
  ],
  "require": {
    "php": "^7.0.0",
    "ext-SPL": "*",
    "ext-SimpleXML": "*",
    "ext-Zend-OPcache": "*",
    "ext-ctype": "*",
    "ext-curl": "*",
    "ext-date": "*",
    "ext-dom": "*",
    "ext-filter": "*",
    "ext-gd": "*",
    "ext-hash": "*",
    "ext-json": "*",
    "ext-openssl": "*",
    "ext-pcre": "*",
    "ext-pdo": "*",
    "ext-pdo_mysql": "*",
    "ext-session": "*",
    "ext-tokenizer": "*",
    "ext-xml": "*",
    "lib-curl": "^7.36.0",
    "lib-iconv": "*",
    "lib-libxml": "*",
    "lib-openssl": "*",
    "lib-pcre": "*",
    "composer/installers": "^1.3",
    "cweagans/composer-patches": "~1.6.2",
    "drupal-composer/drupal-scaffold": "^2.3",
    "drupal/admin_toolbar": "^1.19",
    "drupal/advagg": "^4.0",
    "drupal/allowed_formats": "^1.1",
    "drupal/autologout": "^1.0",
    "drupal/cdn": "3.x-dev",
    "drupal/ckeditor_iframe": "^2.0",
    "drupal/ckeditor_media_embed": "1.x-dev",
    "drupal/color_field": "2.x-dev",
    "drupal/console": "^1.8.0",
    "drupal/core": "8.8.1",
    "drupal/crop": "1.x-dev",
    "drupal/date_popup": "1.x-dev",
    "drupal/draggableviews": "1.x-dev",
    "drupal/drush_language": "dev-8.x-1.x",
    "drupal/eck": "^1.0",
    "drupal/entity": "^1.0-rc1",
    "drupal/entityqueue": "1.x-dev",
    "drupal/fakeobjects": "1.x-dev",
    "drupal/field_group": "^3.0-beta1",
    "drupal/field_hidden": "^1.0",
    "drupal/file_version": "^1.0",
    "drupal/form_mode_manager": "2.x-dev",
    "drupal/image_widget_crop": "^2.1",
    "drupal/inline_entity_form": "1.x-dev",
    "drupal/jwt": "^1.0@alpha",
    "drupal/maxlength": "1.0-beta4",
    "drupal/media_entity": "1.x-dev",
    "drupal/media_entity_image": "1.x-dev",
    "drupal/memcache": "2.x-dev",
    "drupal/migrate_plus": "^4.0",
    "drupal/migrate_source_csv": "2.2",
    "drupal/migrate_tools": "^4.0",
    "drupal/pathauto": "1.6",
    "drupal/restui": "^1.17",
    "drupal/toolbar_menu": "^2.1",
    "drupal/ultimate_cron": "^2.0",
    "drush/drush": "8.x-dev"
  },
  "require-dev": {
    "behat/behat": "^3.4",
    "behat/mink-extension": "^2.2",
    "behat/mink-goutte-driver": "^1.2",
    "composer/composer": "^1.5@dev",
    "doctrine/cache": "~1.6.2",
    "doctrine/collections": "~1.4.0",
    "doctrine/common": "~2.7.0",
    "doctrine/inflector": "~1.2.0",
    "doctrine/instantiator": "~1.0.5",
    "drupal/coder": "^8.2",
    "drupal/config_inspector": "1.x-dev",
    "drupal/devel": "1.x-dev",
    "kgaut/potx": "8.x-1.x-dev",
    "phpunit/phpunit": "^6.1",
    "squizlabs/php_codesniffer": "^2.7.0",
    "symfony/phpunit-bridge": "^3.4.3"
  },
  "scripts": {
  },
  "type": "project"
}

Any ideas, will be appreciated!

0

2 Answers 2

3

Remove "preferred-install": "source" from config or set it to "dist".
Putting "source" means Composer will get a package from a version control repository. And it seems to be downloading directly from https://git.drupalcode.org where all projects have no fixed version in their info files no matter which Git tag you check out.

You also can set more advanced patterns, check https://getcomposer.org/doc/06-config.md#preferred-install. In your case it probably can be boiled down to the following.

{
    "config": {
        "preferred-install": {
            "drupal/*": "dist",
            "*": "source"
        }
    }
}

Then remove vendor/, remove the lock file and reinstall. rm -rf vendor/ && rm composer.lock && composer install.

0

As pointed out in the other answer, you are getting Git checkouts due to the "preferred-install": "source" in the composer.json file. You could remove that (or replace the "source" value with "dist", although presumably you have that there for a reason).

To solve this problem, there is the Composer Deploy module, which augments Drupal's internal version information with information from composer's metadata. If you want to install from source and you want version information, this is the way to do it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.