cancel
Showing results for 
Search instead for 
Did you mean: 

Magento\Catalog\Model\Category\Attribute\Backend\DefaultSortby" does not exist in Magento 2.4.7-p2

Magento\Catalog\Model\Category\Attribute\Backend\DefaultSortby" does not exist in Magento 2.4.7-p2

I'm facing an issue while trying to create a category in Magento 2.4.7-p2  The following error appears when i click categories from Catalog from the Magento 2 Admin

1 exception(s):
Exception #0 (ReflectionException): Class "Magento\Catalog\Model\Category\Attribute\Backend\DefaultSortby" does not exist

What I've tried so far:

  1. Ran php bin/magento setup:di:compile, php bin/magento setup:upgrade, and php bin/magento cache:flush.
  2. Checked the file path vendor/magento/module-catalog/Model/Category/Attribute/Backend/DefaultSortby.php, and it seems that the file doesn't exist.
  3. Reinstalled the magento/module-catalog using composer remove and composer require.
  4. Disabled third-party modules to check for any extension conflicts.
  5. Verified file permissions and recompiled static content.
  6. Enabled developer mode and checked logs in var/log/exception.log and var/log/system.log.

Despite trying these steps, the issue persists. Has anyone encountered a similar issue or knows what might be causing this? Any help or guidance would be greatly appreciated!

2 REPLIES 2

Re: Magento\Catalog\Model\Category\Attribute\Backend\DefaultSortby" does not exist in Magento 2

Hello @mahade hassan_khan,

 

1. Disable all third party module once.

2. run all commands and check.

3. if issue still persists, then check any attribute using that class in database.

4. Check eav_attribute table backend class in database.

 

Let me know if you find anything in database table.

 

I hope it helps!

Problem Solved ? Click on 'Kudos' & Accept as Solution ! Smiley Happy

Re: Magento\Catalog\Model\Category\Attribute\Backend\DefaultSortby" does not exist in Magento 2

It looks like you're missing the DefaultSortby class in Magento 2.4.7-p2. Here’s what you can try:

  1. Confirm Version: Make sure your Magento version is 2.4.7-p2.
  2. Check Documentation: Verify if the class was deprecated or removed in this version.
  3. Review Custom Code: Ensure no custom modules are referencing the missing class.
  4. Update Modules: Ensure all third-party modules are compatible and updated.
  5. Database Check: Run php bin/magento setup:db-data:upgrade to sync the database schema.
  6. Consult Resources: Look for similar issues on Magento forums or GitHub.