Block class module has a 8.x-1.x-dev version. Installing using the recommended command from the specific release page

composer require 'drupal/block_class:1.x-dev'

installs a versionless block_class.

Why is that and what are the implication on future composer update ?

UPDATE: when installing with drush

drush dl block_class --select 

and choose latest dev version that version is 1.0-alpha1+10-dev how can one install the latest alpha-dev ?

  • 1.x-dev is not installing alpha. Not sure what exactly you want to do, just leave out the version specification and composer will automatically figure out th best version constraint that should pick up the alpha – Berdir Apr 28 at 10:14
  • but when I install with drush then the version is '1.0-alpha1+10-dev` how can I install that version with composer – GiorgosK Apr 28 at 10:18

As I said, just don't specify a version and composer will automatically pick a version constraint that installs the most stable version:

$ composer require drupal/block_class
Using version ^1.0@alpha for drupal/block_class
./composer.json has been updated
Gathering patches for root package.
> DrupalProject\composer\ScriptHandler::checkComposerVersion
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 1 install, 0 updates, 0 removals
Gathering patches for root package.
Gathering patches for dependencies. This might take a minute.
  - Installing drupal/block_class (1.0.0-alpha1): Loading from cache
Writing lock file
Generating autoload files
> DrupalProject\composer\ScriptHandler::createRequiredFiles
  • but even in your sample run it does not install 1.0-alpha1+10-dev but 1.0-alpha1 – GiorgosK Apr 28 at 13:41
  • 1
    Right, I missed that part. You can't do that. there is no such thing as a "alpha dev" version, that's just dev. that version number is how drupal.org builds packages but they are temporary and replaced every time there is a new one. As soon as there is a new commit, you won't ever be able to install "1.0-alpha1+10-dev" again. And with composer, you can only install a dev version as a git checkout. If you want to lock it down, you can use #commit-hash. – Berdir Apr 28 at 13:46
  • @GiorgosK 1.0-alpha1+10-dev just means the development snapshot has 10 commits more than the 1.0-alpha1 version. As Berdir said, it doesn't mean it's not a development snapshot, or an alpha dev version as you say. – kiamlaluno Apr 28 at 16:10
  • yes you are right there is no such thing as alpha-dev but did not know what to call it and within drupal module page this is the version that one sees. My main concern is what would happen when I run the composer update in the future with this dev version installed when there is a new version out. Will it pick it up ? I guess it will. – GiorgosK Apr 28 at 16:22
  • Yeah, I didn't quite get that, sorry. Depends on what you want. If you have the constraint like that, then yes, it will update to the latest dev version every time you run composer update. If you do not want that, then you can lock it down to a specific commit as suggested above. – Berdir Apr 29 at 13:12

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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