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 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 in d102b09 Aug 8, 2018
@tflight

This comment has been minimized.

Copy link
Author

@tflight tflight commented Aug 8, 2018

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

@dg

This comment has been minimized.

Copy link
Member

@dg dg commented Aug 8, 2018

You're welcome :)

@holtkamp

This comment has been minimized.

Copy link
Contributor

@holtkamp holtkamp commented Aug 13, 2018

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

This comment has been minimized.

Copy link
Member

@dg dg commented Aug 13, 2018

Tagged

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.