fixes #4897 Error when you click on categories re-order

Fixed the issue and committed code for review, please check it.