This module requires Flag as ^4.0@, which prevents 5.x from being installed.

Other modules that support 4.x and 5.x have the requirement as * or ^4.0 || ^5.0.

drupal/eca_flag 2.0.5 requires drupal/flag (^4.0 || ^5.0)
drupal/flag_anon 1.1.0 requires drupal/flag (*)
drupal/flag_assign_user 1.0.1 requires drupal/flag (*)
drupal/flag_block 2.0.0 requires drupal/flag (^4.0@beta)
drupal/flag_conditional_confirm 2.1.2 requires drupal/flag (*)
drupal/flag_lists 4.0.3 requires drupal/flag (^4.0)
drupal/flag_route 1.0.0-alpha1 requires drupal/flag (*)
drupal/message_subscribe 2.0.1 requires drupal/flag (^4.0)
drupal/tasks 1.0.3 requires drupal/flag (^4.0@beta)
drupal/tasks_extras 1.0.0-beta1 requires drupal/flag (^4.0@beta)
drupal/views_flag_refresh 1.0.2 requires drupal/flag (^4.0@beta)

Shall we go with *?

CommentFileSizeAuthor
#19 3556762-support-flag5-19.patch278 bytesjviitamaki

Issue fork flag_lists-3556762

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

mortona2k created an issue. See original summary.

mortona2k’s picture

Status: Active » Needs review

Flag 5.x has no breaking changes listed.

sl27257’s picture

Assigned: Unassigned » sl27257

Hi,

thanks for the report!

Let me check a few things!

BR

/Thomas

sl27257’s picture

I have tried it now. Technically it works, as far as I can see.

However, what didn't work for me was the upgrade of the flag module to 5.0. Something in composer stopped the upgrading of flag from working.

Also I had a dependency in the info file to restrict some older flag modules from being used. But given that we will recommend flag 5.0 maybe that is not so important any longer.

/Thomas

sl27257’s picture

Another thing that popped up in my head, is that I have written that the reason for calling it flag_lists 4.0.x is / was that, that was the number of the flag module. So to be following that strictly the flag_lists module should be stepped to 5.0.x...

/Thomas

seantwalsh’s picture

@sl27257 are you open to cutting a new 5.0.x release that only supports flag 5? In the meantime, I think a better approach than * is to mirror what other modules are doing to support 4 and 5, such as views_flag_refresh ^4.0@beta || ^5.0.

sl27257’s picture

Thanks for the reminder!

I see that my local copy here is running with only "flag". Give me a few days and I will push .info.yml that supports Flag 5.0.

(And then the question about changing major version still remains but that is not a blocker.)

BR

/Thomas

sl27257’s picture

Status: Needs review » Patch (to be ported)

Now the fix is in the dev.

sl27257’s picture

Status: Patch (to be ported) » Fixed

Now pushed as Flag_lists 4.0.4

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

prudloff’s picture

This breaks composer require:

https://packages.drupal.org/8 could not be fully loaded (curl error 3 while downloading https://packages.drupal.org/files/packages/8/p2/drupal/flag ^4.0@beta || ^5.0.json: URL rejected: Malformed input to a URL function), package information was loaded from the local cache and may be out of date

Installation failed, reverting ./composer.json and ./composer.lock to their original content.

In CurlDownloader.php line 398:
                                                                                                                                                                      
  curl error 3 while downloading https://packages.drupal.org/files/packages/8/p2/drupal/flag ^4.0@beta || ^5.0.json: URL rejected: Malformed input to a URL function 

It looks like drupal.org converts this constraint to a require on a package named "drupal/flag ^4.0@beta || ^5.0".

Constraints in .info.yml are more restrictive than in Composer: https://www.drupal.org/docs/develop/creating-modules/let-drupal-know-abo...
So I don't think it supports ^4.0@beta || ^5.0.

sl27257’s picture

I saw something like this when using 4.0.4. Because of this I re-rolled the patch and created 4.0.5. So which of the versions are you trying out?

prudloff’s picture

I think it was 4.0.4 (4.0.5 probably didn't exist yet).

4.0.5 does not have this problem but it seems it requires flag 4:

  Problem 1
    - Root composer.json requires drupal/flag_lists ^4.0.5 -> satisfiable by drupal/flag_lists[4.0.5].
    - drupal/flag_lists 4.0.5 requires drupal/flag ^4.0 -> found drupal/flag[dev-4.x, 4.0.0-alpha1, ..., 4.x-dev (alias of dev-4.x)] but it does not match your minimum-stability.

I think it's because this constraint in composer.json overrides the one in flag_lists.info.yml: https://git.drupalcode.org/project/flag_lists/-/blob/4.0.x/composer.json...

sl27257’s picture

Well, seems like the Drupal documentation is not so clear on this, it is too utterly complicated nowadays.

I'll remove the old compatibility and accept only 5.0... Do you think that will help?

/Thomas

(For the record: https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Component%21Vers... )

Status: Fixed » Closed (fixed)

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

sl27257’s picture

Status: Closed (fixed) » Needs work
sl27257’s picture

Status: Needs work » Needs review

In the -dev is currently a version of the flag_lists.info.yml with a completely stripped version dependency for the flag module.

jviitamaki’s picture

StatusFileSize
new278 bytes

There's also version constraint in composer.json which prevents updating to flag 5.0.

jviitamaki’s picture

Status: Needs review » Needs work
sl27257’s picture

#3556762-19: Support Flag 5.x:

To my knowledge (and after checking around) I can't find a way to update the composer.json directly from a new release of a module???

/Thomas

mortona2k’s picture

@sl27257 Are you asking how to install a module with a patched composer.json in a MR?

I updated the MR with patch #19, so it's composer.json is:
"drupal/flag": "^4.0 || ^5.0".

flag_lists.info.yml is:

 dependencies:
  - flag:flag 

In your root composer.json, add this repository:

    "repositories": [
        {
            "type": "vcs",
            "url": "git@git.drupal.org:issue/flag_lists-3556762.git"
        },
   ]

Then require with:
composer require drupal/flag_lists:dev-3556762-support-flag-5.x

mortona2k’s picture

If you would like to test this module with flag 5.x on drupal 12, the drupal core requirement will need to be adjusted in the info file.

I added that change to the automated drupal 12 issue, in the 3598361-automated-drupal-12 branch.

Then I merged that branch into this issue's 3556762-support-flag-5.x--drupal12 branch, so you can get both at once.

Follow the steps above above to configure the issue fork repo, then require flag_lists with:

composer require drupal/flag_lists:dev-3556762-support-flag-5.x--drupal12

mortona2k’s picture

Status: Needs work » Needs review