No matter what I add as version, I always get alpha1 with composer and the Module-Folder is named "viewsreferennce".
Maybe there is a conflict with an old repository? https://packagist.drupal-composer.org/search/?q=viewsre
On https://packagist.drupal-composer.org/packages/drupal/viewsreferennce it does say in the bottom right: "Replaces: drupal/viewsreference: 8.1.0-alpha1". Maybe there lies the reason of the issues we're experiencing?

Comments

Ayrmax created an issue. See original summary.

ayrmax’s picture

NewZeal’s picture

Views reference has its own packagist entry: https://packagist.drupal-composer.org/packages/drupal/viewsreference . All the entries in the composer.json reference viewsreference, so I cannot see why composer should reference the wrong entry. Is there something we can add to composer.json to force the right entry?

gngn’s picture

Same (similiar?) problem here.
My "require"-entry in composer.json is: "drupal/viewsreference": "~1.0".
Trying composer update --dry-run I get two(!) entries:

  - Installing drupal/viewsrefere<strong>nn</strong>ce (1.0.0-alpha1)
  - Installing drupal/viewsreference (1.0.0-alpha1)

So it's one wrongly named viewsreferennce and one correct viewsreference . Both say 1.0.0-alpha1 - current version is 1.0-alpha7.
Because I really needed the module I just downloaded alpha7 without composer...

Maybe someone can delete the viewsreferennce entry
https://packagist.drupal-composer.org/packages/drupal/viewsreferennce ?

Patrick Bauer’s picture

@new-zeal
We're using the official D8 repository (https://packages.drupal.org/8) and not the deprecated drupal-composer.org one.

In the official package repo, theres only one version specified (alpha-1):

composer show -a drupal/viewsreference

name     : drupal/viewsreference
descrip. : Enables Views to be embedded in an entity reference field
keywords :
versions : 1.0.0-alpha1
type     : metapackage
license  : GPL-2.0+
source   : []
dist     : []
names    : drupal/viewsreference

I don't know how the repo is managed, but you may have to update your package there.

gngn’s picture

composer show also finds viewsreferennce (also alpha1):

composer show -a drupal/viewsreferennce

name     : drupal/viewsreferennce
descrip. :
keywords :
versions : 1.0.0-alpha1
type     : drupal-module
license  : GPL-2.0+
source   : [git] https://git.drupal.org/project/viewsreferennce 8.x-1.0-alpha1
dist     : [zip] https://ftp.drupal.org/files/projects/viewsreferennce-8.x-1.0-alpha1.zip
names    : drupal/viewsreferennce

support
source : http://cgit.drupalcode.org/viewsreferennce

requires
drupal/core ~8.0
NewZeal’s picture

This bug was caused by a previous (embarrasing!) mis-spelling of this module when creating a repository. I have renamed the info file for that module to viewsreferennce.info.yml and so now this problem does not occur when using composer. FYI I got the url https://www.drupal.org/project/viewsreferennce directed to this page so you cannot visit the previous (embarrassing) module page.

Please confirm and I'll mark this fixed.

gngn’s picture

Running composer update --dry-run I'm still getting

  - Installing drupal/viewsreferennce (1.0.0-alpha1)
  - Installing drupal/viewsreference (1.0.0-alpha1)

composer show -a drupal/viewsreferennce returns two versions:
versions : 1.0.0-alpha2, 1.0.0-alpha1

composer show -a drupal/viewsreference returns one version:
versions : 1.0.0-alpha1

Maybe I'm doing something wrong...?

NewZeal’s picture

Are you running

composer require drupal/viewsreference

from your Drupal root?

NewZeal’s picture

Your problem may be occurring because of an entry in composer.lock (in your Drupal root). Either delete that entry or the whole composer.lock file and run composer on viewsreference again.

gngn’s picture

  • I'm running composer update --dry-run from my drupal root.
    --dry-run because I fist want to check what will happen.
  • composer.json (residing in the same directory) includes an entry "drupal/viewsreference": "~1.0" in section "require".
  • composer.lock did not include anything with viewsreference or viewsreferennce. I deleted it anyway, but composer update --dry-run still showed "drupal/viewsreferennce (1.0.0-alpha1)" and ""drupal/viewsreference (1.0.0-alpha1)"
dom18fr’s picture

I required drupal/viewsreference for the first time yesterday (no composer.lock), and got the the misspelled viewsreferennce alpha1 too.

tijsdeboeck’s picture

Same issue here, tried to require viewsreference (dev version) and got the same error.
My command was composer require drupal/viewsreference:1.x-dev

I'm also using the official D8 repository (https://packages.drupal.org/8), and running the command from Drupal root

NewZeal’s picture

Currently the viewsreferennce module has no composer.json file and it appears that when you run composer require drupal/viewsreference it looks for a viewsreference.info.yml file in the first instance, maybe because it was created first.

It appears that the name entry of "drupal/viewsreference" in viewsregerence/composer.json has no bearing. Why Drupal composer looks for the info file (or somesuch) rather than the actual project name I cannot explain, but the options available to overcome a problem such as this appear limited.

I am not able to change the contents of viewsreferennce alpha1, because it is Drupal policy not to allow tags to be deleted or changed. It appears that the viewsreference.info.yml file in viewsreferennce gets picked first and there is nothing we can do about it.

I have submitted a request to fix this problem with the composer people at Drupal: https://www.drupal.org/node/2838522

Until that is fixed, you can install using composer by running:

composer require drupal/viewsreference-viewsreference

NewZeal’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

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