Since .info.yml contain "version: VERSION", such VERSION will be replaced by corresponding Drupal core version number. Therefore if install with git checkout, Available Update page will report that coming with an unsupported or incorrect version number.

Documentation for Drupal 7.x (https://www.drupal.org/node/542202#version):

version (Discouraged)
The version string will be added by drupal.org when a release is created and a tarball packaged. However, if your module is not being hosted on the drupal.org infrastructure, you can give your module whatever version string makes sense (eg. see Release naming conventions).

Documentation for Drupal 8.x (https://www.drupal.org/node/2000204#s-complete-example):

  • Restricted properties, added by Drupal packaging system. Do not add these manually to info.yml in your repository.
    • version
    • project
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

hswong3i created an issue. See original summary.

hswong3i’s picture

Aanal.addweb’s picture

Status: Needs review » Reviewed & tested by the community
FileSize
46.36 KB
44.99 KB

@hswong3i, Thanks for adding patch for Drupal 8 I've checked your patch by manually & with Simplytest.me, by both the ways it works well for me. PFA as a result of after patch.

gausarts’s picture

Category: Bug report » Task
Status: Reviewed & tested by the community » Closed (duplicate)

Thank you for contribution.

Let's mark anything Recommended and Discouraged as Task.

Bug is when things or functionality breaks, such as misspelling for docs, or broken codes, etc.

I have replied to this type of issue here:
#2773159: Remove version from slick.info.yml file.

Discouraged is not a definitive "no".

hswong3i’s picture

Version: 8.x-1.x-dev » 8.x-2.x-dev
FileSize
315 bytes

Two years later... Issue still happening for me, patch update for 8.x-2.x-dev.

hswong3i’s picture

Status: Closed (duplicate) » Needs review

Status: Needs review » Needs work

The last submitted patch, 5: blazy-remove_version_from_info_yml-2890216-5.patch, failed testing. View results

gausarts’s picture

Status: Needs work » Closed (duplicate)

This comes up several times. Allow me to make it clear.

Standards are guidelines I agree we value and must follow to some extent.

You don't have errors by breaking standards, you do have warnings. Warnings are not errors! That is why it not a bug.
Worst, unfortunately they are sometimes so generic that they missed a few details and problems that we encounter in everyday life.
Like you missed the information line that I deliberately put in there before the version line.

1. Please read the linked thread, especially my comment:
https://www.drupal.org/project/slick/issues/2773159#comment-11524039
2. Please read the added comment line:

-# Add a fake version so local drush and Git checkouts do not fail dependencies.

If you don't understand:
1. Install Blazy + Slick related modules. Act like a patcher. Do a git checkout with drush combo.
2. Visit /admin/modules. See the problem there? If you don't, try seeing it better.
3. Now install other Blazy related modules which depends on Slick, such ElevateZoom Plus, etc. Repeat 2. And read again the from above. If you still don't see no evil, then stop patching you don't understand.

hswong3i’s picture

Issue summary: View changes
Status: Closed (duplicate) » Needs review

@gausarts sorry that your "add a fake version" tricks may not really works, e.g.

Manage installation with composer.json as below:

{
    "require": {
        "drustack/composer-generate-metadata": "~1.0",
        "drupal/slick_views": "2.x-dev",
    }
}

Therefore the generated *.info.yml becomes:

name: Slick Views
type: module
description: 'Provides Slick carousel integration with Views.'
core: 8.x
core_version_requirement: ^8 || ^9
package: Slick
dependencies:
  - slick:slick (>= 2.x)
  - drupal:views

# Add a fake version so local drush and Git checkouts do not fail dependencies.
version: 8.x-2.x

# Information add by drustack/composer-generate-metadata on 2020-01-20
project: "slick_views"
version: "8.x-2.1+1-dev"
datestamp: "1579493580"

BTW, from admin/reports/updates will shown as:

Slick extras 8.x-1.x
Recommended version:
8.x-1.0-rc2 (2019-Mar-08) 

Which means your hack brake the Available Update page and so showing the incorrect version number.

Shall we follow the official documentation for Drupal 8.x (https://www.drupal.org/node/2000204#s-complete-example) as below?

  • Restricted properties, added by Drupal packaging system. Do not add these manually to info.yml in your repository.
    • version
    • project
gausarts’s picture

Status: Needs review » Postponed (maintainer needs more info)

@hswong3i, I appreciate your persistence. And I am okay, too.

I would be happy to remove the hack line, of course, once I don't see my own problem as outlined at #8. Until then, it is needed to be there at least for me as a maintainer.

However let's break it down again based on your own problem now.

With your new info, we now have two angles/ viewpoints/ perspectives:

  1. Devs, or hence, maintainers problem as outlined at #8. I believed you had read my own problem at #8. If not, please do, so it makes sense to you, too.
  2. End users, as outlined at your comment #9. I had read your comment at #9 very carefully.

Unfortunately, at least from your own comment #9, you don't use regular Drupal.org packaging script (yours is drustack/composer-generate-metadata) which tricks you to think you were having end users problem.

Try using regular Drupal.org packaging script, and see.

For end users, Drupal.org packaging script will comment the hack line automatically, so it goes like this:

# Add a fake version so local drush and Git checkouts do not fail dependencies.
# version: 8.x-2.x

So you don't have no issues at admin/reports/updates. The report will show you the correct end users version. Hence in my case like this:

# Add a fake version so local drush and Git checkouts do not fail dependencies.
# version: 8.x-2.x

# Information added by Drupal.org packaging script on 2020-01-01
version: '8.x-2.0'
project: 'slick'
datestamp: 1577874488

Note the commented line: # version: 8.x-2.x. The commented line will not be read by admin/reports/updates.

But you showed me the non-commented line: version: 8.x-2.x here:

# Add a fake version so local drush and Git checkouts do not fail dependencies.
version: 8.x-2.x

# Information add by drustack/composer-generate-metadata on 2020-01-20
project: "slick_views"
version: "8.x-2.1+1-dev"
datestamp: "1579493580"

which immediately shows that drustack/composer-generate-metadata doesn't do the same thing as Drupal.org packaging script. It is then your drustack issue. Please report the issue to drustack instead.

Let me know if we still need more clarification on this regard.

Since you created similar issues at many of my projects, I would appreciate if you change them to Task, not Bug as I said in #8, for the first step. Once you are being clear on this issue right here, I would appreciate, if you close them all as Duplicate. Thank you!

gausarts’s picture

Status: Postponed (maintainer needs more info) » Closed (duplicate)

Feel free to open if anything. Thanks!