0

When in M2 backend, whether going to edit an existing product or adding a new product, Category selection feature not showing any categories or allow you to add any new categories.

The only error output I'm seeing in system.log is when I click on "New Category":

Notice: Undefined index: optgroup in /var/www/html/vendor/magento/module-catalog/Ui/Component/Product/Form/Categories/Options.php on line 108

Tracking that error down to this line of code from Options.php:

$this->categoriesTree = $categoryById[CategoryModel::TREE_ROOT_ID]['optgroup'];

Also getting this 500 error in browser console for this AJAX URL:

/mui/index/render_handle/handle/catalog_category_create/store/0/buttons/1/key/{token}/?namespace=new_category_form&isAjax=true

I have not installed any new extensions and this was a situation where working fine one day and all of sudden just starting getting this error the next.

I'm kind of not sure what direction to go in troubleshooting, any help is greatly appreciated.

1
  • I'm having the same problem, my version is 2.4.2 and I still haven't found a suitable solution.
    – Lancer
    Commented Sep 23, 2021 at 3:26

1 Answer 1

0

I faced the same issue and the issue is resolved after these steps: enter image description here

enter image description here

And then Clean cache and open catalog->default category and enable that and save again

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.