Skip to content

Commit 3ccf1d9

Browse files
MAGETWO-94565: Catalog product collection filters produce errors and cause inconsistent behaviour
- Fix magento category installation.
1 parent 6d12528 commit 3ccf1d9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ protected function _beforeSave(\Magento\Framework\DataObject $object)
278278
if ($object->getPosition() === null) {
279279
$object->setPosition($this->_getMaxPosition($object->getPath()) + 1);
280280
}
281-
$path = explode('/', $object->getPath());
281+
$path = explode('/', (string)$object->getPath());
282282
$level = count($path) - ($object->getId() ? 1 : 0);
283283
$toUpdateChild = array_diff($path, [$object->getId()]);
284284

@@ -317,7 +317,7 @@ protected function _afterSave(\Magento\Framework\DataObject $object)
317317
/**
318318
* Add identifier for new category
319319
*/
320-
if (substr($object->getPath(), -1) == '/') {
320+
if (substr((string)$object->getPath(), -1) == '/') {
321321
$object->setPath($object->getPath() . $object->getId());
322322
$this->_savePath($object);
323323
}

0 commit comments

Comments
 (0)