File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed
app/code/Magento/Catalog/Model
dev/tests/integration/testsuite/Magento/Catalog/Model Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -846,7 +846,7 @@ public function getPathIds()
846
846
{
847
847
$ ids = $ this ->getData ('path_ids ' );
848
848
if ($ ids === null ) {
849
- $ ids = $ this ->getPath () ? explode ('/ ' , $ this ->getPath ()) : [];
849
+ $ ids = $ this ->getPath () !== null ? explode ('/ ' , $ this ->getPath ()) : ['' ];
850
850
$ this ->setData ('path_ids ' , $ ids );
851
851
}
852
852
return $ ids ;
@@ -860,7 +860,7 @@ public function getPathIds()
860
860
public function getLevel ()
861
861
{
862
862
if (!$ this ->hasLevel ()) {
863
- return $ this ->getPath () ? count (explode ('/ ' , $ this ->getPath ())) - 1 : 0 ;
863
+ return $ this ->getPath () !== null ? count (explode ('/ ' , $ this ->getPath ())) - 1 : 0 ;
864
864
}
865
865
return $ this ->getData (self ::KEY_LEVEL );
866
866
}
Original file line number Diff line number Diff line change @@ -154,7 +154,7 @@ public function testGetAllChildren()
154
154
155
155
public function testGetPathIds ()
156
156
{
157
- $ this ->assertEquals ([], $ this ->_model ->getPathIds ());
157
+ $ this ->assertEquals (['' ], $ this ->_model ->getPathIds ());
158
158
$ this ->_model ->setPathIds ([1 ]);
159
159
$ this ->assertEquals ([1 ], $ this ->_model ->getPathIds ());
160
160
You can’t perform that action at this time.
0 commit comments