Problem/Motivation

This is a blocker for #3249553: Create package_manager validator to ensure the project to be installed is not already installed by Composer.

Project Browser sends package names to its installer without any version constraints, but RequireEventTrait::getKeyedPackages() expects that all the packages will be passed explicit constraints. That leads to brokenness.

Since project browser now sends package names without constraints RequireEventTrait needs to be updated to default to '*' when no constraint is found. We are now using PreRequireEvent in the Validator #3249553: Create package_manager validator to ensure the project to be installed is not already installed by Composer which will use RequireEventTrait.

Proposed resolution

RequireEventTrait::getKeyedPackages() should default any unspecified version constraints to *.

API changes

The behavior of RequireEventTrait's public methods will change to be more consistent.

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

omkar.podey created an issue. See original summary.

omkar.podey’s picture

Status: Active » Needs review
tim.plunkett’s picture

phenaproxima’s picture

Title: Update \Drupal\package_manager\Event\RequireEventTrait to support Project Browser. » RequireEventTrait should default unspecified version constraints to *
Category: Task » Feature request
Status: Needs review » Needs work
Issue tags: +Needs tests
tedbow’s picture

Can we get more info about why this issue was create? thanks

omkar.podey’s picture

Status: Needs work » Needs review
omkar.podey’s picture

Issue summary: View changes
phenaproxima’s picture

Status: Needs review » Needs work
Issue tags: -Needs tests

I think we could make a few upgrades to the test, but overall this looks great. No objections to how the method has been implemented.

phenaproxima’s picture

Assigned: omkar.podey » phenaproxima
Issue summary: View changes
Status: Needs work » Needs review
Issue tags: -Needs issue summary update
phenaproxima’s picture

Status: Needs review » Reviewed & tested by the community

I'm gonna merge this.

phenaproxima’s picture

Assigned: phenaproxima » Unassigned
Status: Reviewed & tested by the community » Fixed

Merged into 8.x-2.x. Thanks!

Status: Fixed » Closed (fixed)

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

tedbow’s picture

Issue tags: +core-mvp