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 6
6
namespace Magento \MediaGalleryCatalogUi \Ui \Component \Listing \Columns ;
7
7
8
8
use Magento \Catalog \Api \CategoryRepositoryInterface ;
9
+ use Magento \Catalog \Model \Category ;
10
+ use Magento \Framework \Exception \NoSuchEntityException ;
9
11
use Magento \Framework \View \Element \UiComponent \ContextInterface ;
10
12
use Magento \Framework \View \Element \UiComponentFactory ;
11
13
use Magento \Ui \Component \Listing \Columns \Column ;
@@ -63,13 +65,15 @@ public function prepareDataSource(array $dataSource)
63
65
* Replace category path ids with category names
64
66
*
65
67
* @param string $pathWithIds
68
+ * @return string
69
+ * @throws NoSuchEntityException
66
70
*/
67
71
private function getCategoryPathWithNames (string $ pathWithIds ): string
68
72
{
69
73
$ categoryPathWithName = '' ;
70
74
$ categoryIds = explode ('/ ' , $ pathWithIds );
71
75
foreach ($ categoryIds as $ id ) {
72
- if ($ id == 1 ) {
76
+ if ($ id == Category:: TREE_ROOT_ID ) {
73
77
continue ;
74
78
}
75
79
$ categoryName = $ this ->categoryRepository ->get ($ id )->getName ();
You can’t perform that action at this time.
0 commit comments