Search code examples
linuxmagentofind

How to locate Magento\Catalog\Model\Category in my Magento 2 file system


I am trying to debug an problem on a Magento 2. I have an error message that mentions the folder Magento\Catalog\Model\Category so I am trying to find this folder to help with debugging. This is either a Magento 2 problem of a general Linux problem depending on if this folder is part of the standard Magento 2 setup or possibly part of an extension. If it standard I would like to find where this folder is, and if it is not I would like to know the correct Linux command to find it.

I tried the command

find / -type d -name 'Magento'

This caused the entire screen fill with permission denied messages. I tried the command to exclude permission denied messages

find / -type d -name 'Magento' 2>/dev/null

This gave nothing which seems to indicate 'Magento' is in a folder that doesn't have read permissions. I looking for advice either on where to look for this folder or on how to temporarily override read permissions in the find command.


Solution

    1. If install magento follow this way https://experienceleague.adobe.com/docs/commerce-operations/installation-guide/composer.html?lang=en, Magento\Catalog\Model\Category should be vendor/magento/module-catalog/Model/Category.php
    2. for the magento2 github, it should be https://github.com/magento/magento2/blob/2.4-develop/app/code/Magento/Catalog/Model/Category.php