We have been having problem moving Magento 2 category. When we try to re-arrange/ move a category we get the error, "There was a category move error." We have increased PHP execution time out and reindexed Magento 2, but still these didn't help.

Any assistance would be much appreciated. Thanks in advance!

  • try this github.com/magento/magento2/commit/… – Krishna ijjada May 29 '16 at 4:16
  • Hi. I did try your fix but it actually caused many other problems... :) 1- I couldn't find that path in my installation. 2- So I created the path by adding the diffrent folders and file and the content app/code/Magento/Catalog/view/adminhtml/templates/catalog/category/edit/form.phtml 3- when I did that it broke the entire website – P. Paul Jun 19 '16 at 12:11
  • @ P. Paul Sorry you misplaced, please check the answer. – Krishna ijjada Jun 19 '16 at 16:54

i had the same problem and i successfully could solve it but i am not sure that it is the correct solution. let's go to the solution ...

first of all i explain the problem first: imagine i have 1 main category and it has 6 sub-category and i want to move one of the sub-category to out of the sub-category so it become another main category.

enter image description here

solution : find the sub-category's ID and the main category's ID that you want to move the sub-category under it. then open the PHPMyAdmin(OR what ever Your DataBase Administration tool is) section and go the related Database and go to the "catalog_category_entity" Table.

enter image description here

find the sub-category's ID in the "entity_id" column and change the "parent_id" column's value to to the main category's ID that u want to move the sub-category to it.

enter image description here

save the table and drag and drop it again. that's it.

enter image description here

final result ;-)

enter image description here

if it doesn't work for u just let me know, so i can help u.

  • Hello. Thanks for the help. I will try that and let you know as soon as possible. – P. Paul Aug 27 '16 at 19:42

Please try below


Around line number 34

<form id="category_edit_form" action="<?php echo $block->getSaveUrl() ?>" method="post" enctype="multipart/form-data">

Replace with

<form id="category_edit_form" name="category_edit_form" action="<?php echo $block->getSaveUrl() ?>" method="post" enctype="multipart/form-data">


around line number 472

$('form .messages').html(data.messages);

Replace with

$('[name="category_edit_form"] .messages').html(data.messages);

Make sure remove cache , set proper permission , run setup:upgrade before check.

Hope this helps.

  • Hello Krishna-- Thank you so much for the support. I have changed/ replaced the line in the first file (form.phtml), but the second file "tree.phtml" was already the same so I didn't changed/ replace anything in it. I cleared the cache and ran "setup:upgrade" then tried again. I didn't get the error message anymore, which was a good sign, but the category were not moved. I think the issue is close to being resolved. :) Any other tricks? Thank you! – P. Paul Jun 30 '16 at 19:11

Try changing the indexing mode to Manual indexing before moving categories . Once categories are moved , do reindex and you can also set back the indexing mode to reindex on save Thanks

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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