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

Info Error with Composer 1.7.0 lock files as no longer requires dist and source attributes #311

Closed
tflight opened this issue Aug 8, 2018 · 4 comments

Comments

@tflight
Copy link

tflight commented Aug 8, 2018

Version: 2.4.14 - 2.5.1

Bug Description

Starting with Composer 1.7.0, the source and dist attributes of a package are no longer added to the composer.lock file for metapackages. See composer/composer#7501 Therefore the info panel errors if you have a metapackage in your composer.lock such as https://github.com/Roave/SecurityAdvisories. Also see #287 for an older, related issue.

Steps To Reproduce

composer self-update to update to composer 1.7.0 and require a metapackage such as composer require --dev roave/security-advisories:dev-master. View the info panel where you should see an error.

Expected Behavior

No error in the info panel, show installed composer packages.

Possible Solution

Don't assume $package->source and $package->dist are set at

<tr><td><?= Helpers::escapeHtml($package->name) ?></td><td><?= Helpers::escapeHtml($package->version . (strpos($package->version, 'dev') === false ? '' : ' #' . substr($package->source->reference ?? $package->dist->reference, 0, 4))) ?></td></tr>
and
<tr><td><?= Helpers::escapeHtml($package->name) ?></td><td><?= Helpers::escapeHtml($package->version . (strpos($package->version, 'dev') === false ? '' : ' #' . substr($package->source->reference ?? $package->dist->reference, 0, 4))) ?></td></tr>

dg added a commit that referenced this issue Aug 8, 2018
dg added a commit that referenced this issue Aug 8, 2018
@dg dg closed this as completed in d102b09 Aug 8, 2018
@tflight
Copy link
Author

tflight commented Aug 8, 2018

Thanks, @dg! That is a better solution than I was thinking of.

@dg
Copy link
Member

dg commented Aug 8, 2018

You're welcome :)

@holtkamp
Copy link
Contributor

Encountered this as well and really impressed by the quality of the issue report of @tflight !

@dg are you considering tagging a new release with this fix?

@dg
Copy link
Member

dg commented Aug 13, 2018

Tagged

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants