Bug #23476 Bug Fixed

Categories Control Panel Can Break

Version: 4.0.9 Reporter: MindPixel

I noticed that you can completely break access to the Categories Control Panel after making a category parent, and then accidentally assigning itself to it’s own group.

For example, make a category called Language then click save. Then create another one, let’s say PHP and assign it to the Language as the parent. If you go edit the parent category Language from the CP/pencil edit button, you can accidentally assign itself to it’s own parent group and it breaks the Categories Control Panel blocking accessing to it when you go back to the main CP index.

http://ee4.qa/admin.php?/cp/categories/group/1

Exception Caught
Cannot add tree node to itself.
ee/legacy/libraries/datastructures/Tree.php:243

Stack Trace: Please include when reporting this error
#0 ee/legacy/libraries/datastructures/Tree.php(122): EE_TreeNode->add(Object(EE_TreeNode))
#1 ee/legacy/libraries/datastructures/Tree.php(54): EE_Tree->_build_tree(Object(EllisLab\ExpressionEngine\Service\Model\Collection), Array)
#2 ee/EllisLab/ExpressionEngine/Model/Category/CategoryGroup.php(122): EE_Tree->from_list(Object(EllisLab\ExpressionEngine\Service\Model\Collection), Array)
#3 ee/EllisLab/ExpressionEngine/Controller/Categories/Categories.php(77): EllisLab\ExpressionEngine\Model\Category\CategoryGroup->getCategoryTree(Object(EE_Tree))
#4 [internal function]: EllisLab\ExpressionEngine\Controller\Categories\Categories->group('1')
#5 ee/EllisLab/ExpressionEngine/Core/Core.php(240): call_user_func_array(Array, Array)
#6 ee/EllisLab/ExpressionEngine/Core/Core.php(109): EllisLab\ExpressionEngine\Core\Core->runController(Array)
#7 ee/EllisLab/ExpressionEngine/Boot/boot.php(146): EllisLab\ExpressionEngine\Core\Core->run(Object(EllisLab\ExpressionEngine\Core\Request))
#8 admin.php(147): require_once('...')
#8 admin.php(147): require_once('...')
  • I’m unable to reproduce. The UI should not let you select the current category you’re editing as its own parent. The option should be disabled in the list. How are you able to select it?

    Kevin Cupp
    19th February, 2018 at 2:54pm
  • Try the following:

    1. Navigate to Developer > Categories
    2. Create a new Category Group, let’s name it Example
    3. Click the newly created category group on the left sidebar to add categories within
    4. Create a category called Parent, click Save and New
    5. Create a category called Child Category, assign it to the Parent Category, click save
    6. On the left sidebar, click our Example group again.
    7. Within the grid on the left showing our categories, click the Pencil icon to edit the Parent category.
    8. You will then notice that you can actually assign the parent to itself. Within the bottom where it says Parent category, the currently open category is no longer disabled from being assigned to itself.

    If these steps do not help you to reproduce the issue still I can make a video detailing it.

    MindPixel
    20th February, 2018 at 8:51am
  • Thanks for those steps! I’m unable to reproduce with the Parent category, BUT I can reproduce with the Child category, meaning I can assign it to be its own parent and then break the Category Manager. Maybe that’s enough for me to go on, I’ll see what we can do to fix this and hopefully it’ll all be squared away on your end. Thanks again!

    Kevin Cupp
    20th February, 2018 at 11:04am
  • No problem Kevin! Happy to help!

    MindPixel
    20th February, 2018 at 11:24am
  • Hello I have this problem how do I fix it?

    Dot Voice
    15th June, 2018 at 5:59pm

You must be signed in to comment on a bug report.

ExpressionEngine News

#eecms, #events, #releases