Skip to content

Commit 909763d

Browse files
committed
Merge remote-tracking branch 'karyna/fix-webapi-for-php8.1' into ph-delivery
2 parents 678800d + d724136 commit 909763d

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

app/code/Magento/Catalog/Model/Category.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -846,7 +846,7 @@ public function getPathIds()
846846
{
847847
$ids = $this->getData('path_ids');
848848
if ($ids === null) {
849-
$ids = $this->getPath() ? explode('/', $this->getPath()) : [];
849+
$ids = $this->getPath() !== null ? explode('/', $this->getPath()) : [''];
850850
$this->setData('path_ids', $ids);
851851
}
852852
return $ids;
@@ -860,7 +860,7 @@ public function getPathIds()
860860
public function getLevel()
861861
{
862862
if (!$this->hasLevel()) {
863-
return $this->getPath() ? count(explode('/', $this->getPath())) - 1 : 0;
863+
return $this->getPath() !== null ? count(explode('/', $this->getPath())) - 1 : 0;
864864
}
865865
return $this->getData(self::KEY_LEVEL);
866866
}

dev/tests/integration/testsuite/Magento/Catalog/Model/CategoryTreeTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ public function testGetAllChildren()
154154

155155
public function testGetPathIds()
156156
{
157-
$this->assertEquals([], $this->_model->getPathIds());
157+
$this->assertEquals([''], $this->_model->getPathIds());
158158
$this->_model->setPathIds([1]);
159159
$this->assertEquals([1], $this->_model->getPathIds());
160160

0 commit comments

Comments
 (0)