Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ArrayLoader: fix integer index of branch alias #10660

Merged
merged 1 commit into from Mar 29, 2022

Conversation

glaubinix
Copy link
Contributor

@glaubinix glaubinix commented Mar 24, 2022

Fixes Console Exception: strtolower(): Argument #1 ($string) must be of type string, int given in ArrayLoader.php:440

For example, happens for package "silverstripe/crontask" from packagist.org which has an extra key with value {"branch-alias":{"1":"1.3.x-dev"}} in version 1.x-dev

$this->assertSame('2019', $package->getSourceReference());
$this->assertSame('2019', $package->getDistReference());
Copy link
Member

@Seldaek Seldaek Mar 26, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The assertion is wrong here, probably should check that we get an alias package with the expected version or something?

Copy link
Contributor Author

@glaubinix glaubinix Mar 26, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, copied this and never updated it. I adjusted the test and I am only calling the getBranchAlias method. I am not sure, I understand what you mean with the alias package. The branch alias will never match because 1 does not match a dev version.

@Seldaek
Copy link
Member

@Seldaek Seldaek commented Mar 26, 2022

Good find, super nasty these numeric array indices..

@Seldaek Seldaek added this to the 2.3 milestone Mar 26, 2022
@Seldaek Seldaek added the Bug label Mar 26, 2022
@glaubinix glaubinix force-pushed the f/branch-alias-numeric-array-index branch from a03f403 to 92e47ee Compare Mar 26, 2022
@glaubinix glaubinix force-pushed the f/branch-alias-numeric-array-index branch from 92e47ee to f1371d3 Compare Mar 26, 2022
@Seldaek Seldaek merged commit 9f8ee0e into composer:main Mar 29, 2022
16 of 17 checks passed
@glaubinix glaubinix deleted the f/branch-alias-numeric-array-index branch Mar 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants