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()
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 }
Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments