Skip to content

Commit 3ccbd2f

Browse files
eddielauOlga Kopylova
authored andcommitted
MAGETWO-33157: Conflict restriction checking is missing version checking in enable/disable module CLI
- added checkign for empty version
1 parent 23538b5 commit 3ccbd2f

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

lib/internal/Magento/Framework/Module/ConflictChecker.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,14 +71,20 @@ public function checkConflictsWhenEnableModules($moduleNames)
7171
private function checkIfConflict($moduleA, $moduleB)
7272
{
7373
$versionParser = new VersionParser();
74-
if (isset($this->packageInfo->getConflict($moduleB)[$moduleA]) && $this->packageInfo->getVersion($moduleA)) {
74+
if (isset($this->packageInfo->getConflict($moduleB)[$moduleA]) &&
75+
$this->packageInfo->getConflict($moduleB)[$moduleA] &&
76+
$this->packageInfo->getVersion($moduleA)
77+
) {
7578
$constraintA = $versionParser->parseConstraints($this->packageInfo->getConflict($moduleB)[$moduleA]);
7679
$constraintB = $versionParser->parseConstraints($this->packageInfo->getVersion($moduleA));
7780
if ($constraintA->matches($constraintB)) {
7881
return true;
7982
}
8083
}
81-
if (isset($this->packageInfo->getConflict($moduleA)[$moduleB]) && $this->packageInfo->getVersion($moduleB)) {
84+
if (isset($this->packageInfo->getConflict($moduleA)[$moduleB]) &&
85+
$this->packageInfo->getConflict($moduleA)[$moduleB] &&
86+
$this->packageInfo->getVersion($moduleB)
87+
) {
8288
$constraintA = $versionParser->parseConstraints($this->packageInfo->getConflict($moduleA)[$moduleB]);
8389
$constraintB = $versionParser->parseConstraints($this->packageInfo->getVersion($moduleB));
8490
if ($constraintA->matches($constraintB)) {

0 commit comments

Comments
 (0)