Skip to content

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

@tflight

Description

@tflight

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>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions