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

Undefined class constant 'VERSIONS' #6

Closed
fritzmg opened this issue Jan 14, 2021 · 3 comments
Closed

Undefined class constant 'VERSIONS' #6

fritzmg opened this issue Jan 14, 2021 · 3 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@fritzmg
Copy link

fritzmg commented Jan 14, 2021

contao-community-alliance/contao-polyfill-bundle requires ocramius/package-versions with a version requirement of ^1.4 and uses PackageVersions\Version::VERSIONS here:

foreach (Versions::VERSIONS as $name => $version) {
if (0 !== \strncmp('contao-components/', $name, 18)) {
continue;
}
$serviceId = 'assets._package_' . $name;
$basePath = 'assets/' . \substr($name, 18);
$version = $this->createVersionStrategy($container, $version, $name);
$container->setDefinition($serviceId, $this->createPackageDefinition($basePath, $version, $context));
$packages->addMethodCall('addPackage', [$name, new Reference($serviceId)]);
}

Unfortunately this constant was removed in version 1.10.0 of ocramius/package-versions. Thus if you happen to have ocramius/package-versions installed in a version equal or greater than 1.10.0, the following error will occur:

Fatal error: Uncaught Error: Undefined class constant 'VERSIONS' in vendor/contao-community-alliance/contao-polyfill-bundle/src/Polyfill45/DependencyInjection/Compiler/AddAssetsPackagesPass.php:111
Stack trace:
#0 vendor/contao-community-alliance/contao-polyfill-bundle/src/Polyfill45/DependencyInjection/Compiler/AddAssetsPackagesPass.php(52): ContaoCommunityAlliance\Polyfills\Polyfill45\DependencyInjection\Compiler\AddAssetsPackagesPass->addComponents(Object(Contao\ManagerPlugin\Config\ContainerBuilder))
#1 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/Compiler.php(140): ContaoCommunityAlliance\Polyfills\Polyfill45\DependencyInjection\Compiler\AddAssetsPackagesPass->process(Object(Contao\ManagerPlugin\Config\ContainerBuilder))
#2 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/ContainerBuilder.php(789): Symfony\Component\DependencyInjection\Compiler\Compiler->comp in vendor/contao-community-alliance/contao-polyfill-bundle/src/Polyfill45/DependencyInjection/Compiler/AddAssetsPackagesPass.php on line 111
@zonky2 zonky2 added the bug Something isn't working label Jan 14, 2021
@zonky2 zonky2 added this to the 1.2.0 milestone Jan 14, 2021
@baumannsven baumannsven modified the milestones: 1.2.0, 1.1.5 Feb 4, 2021
@baumannsven
Copy link
Member

@fritzmg Can you install the hotfix/1.1.5 branch and show if the problem is fixed

@zonky2
Copy link

zonky2 commented Feb 12, 2021

@baumannsven see new PR #9

@baumannsven baumannsven linked a pull request Feb 13, 2021 that will close this issue
@baumannsven
Copy link
Member

Fixed in PR #9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants