File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
app/code/Magento/MediaGalleryCatalogUi/Ui/Component/Listing/Columns Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change 66namespace Magento \MediaGalleryCatalogUi \Ui \Component \Listing \Columns ;
77
88use Magento \Catalog \Api \CategoryRepositoryInterface ;
9+ use Magento \Catalog \Model \Category ;
10+ use Magento \Framework \Exception \NoSuchEntityException ;
911use Magento \Framework \View \Element \UiComponent \ContextInterface ;
1012use Magento \Framework \View \Element \UiComponentFactory ;
1113use Magento \Ui \Component \Listing \Columns \Column ;
@@ -63,13 +65,15 @@ public function prepareDataSource(array $dataSource)
6365 * Replace category path ids with category names
6466 *
6567 * @param string $pathWithIds
68+ * @return string
69+ * @throws NoSuchEntityException
6670 */
6771 private function getCategoryPathWithNames (string $ pathWithIds ): string
6872 {
6973 $ categoryPathWithName = '' ;
7074 $ categoryIds = explode ('/ ' , $ pathWithIds );
7175 foreach ($ categoryIds as $ id ) {
72- if ($ id == 1 ) {
76+ if ($ id == Category:: TREE_ROOT_ID ) {
7377 continue ;
7478 }
7579 $ categoryName = $ this ->categoryRepository ->get ($ id )->getName ();
You can’t perform that action at this time.
0 commit comments