No Code Attached Yet bug
avatar Freewindrider
Freewindrider
3 May 2023

Steps to reproduce the issue

  1. New installation of Joomla 4.3.1
  2. Delete the main system category "uncategorized", works without errors or an alert, that at least one (system-)category should be present.
  3. The recreation a new/main category of your choice leads to the following error:

An error has occurred.
0 Joomla\CMS\Toolbar\Toolbar::versions(): Argument #2 ($itemId) must be of type int, null given, called in /home/httpd/vhosts/WHATEVER/administrator/components/com_categories/src/View/Category/HtmlView.php on line 239

Call stack

1 | () | JROOT/libraries/src/Toolbar/CoreButtonsTrait.php:511
2 | Joomla\CMS\Toolbar\Toolbar->versions() | JROOT/administrator/components/com_categories/src/View/Category/HtmlView.php:239
3 | Joomla\Component\Categories\Administrator\View\Category\HtmlView->addToolbar() | JROOT/administrator/components/com_categories/src/View/Category/HtmlView.php:121
4 | Joomla\Component\Categories\Administrator\View\Category\HtmlView->display() | JROOT/administrator/components/com_categories/src/Controller/DisplayController.php:111
5 | Joomla\Component\Categories\Administrator\Controller\DisplayController->display() | JROOT/libraries/src/MVC/Controller/BaseController.php:678
6 | Joomla\CMS\MVC\Controller\BaseController->execute() | JROOT/libraries/src/Dispatcher/ComponentDispatcher.php:143
7 | Joomla\CMS\Dispatcher\ComponentDispatcher->dispatch() | JROOT/libraries/src/Component/ComponentHelper.php:361
8 | Joomla\CMS\Component\ComponentHelper::renderComponent() | JROOT/libraries/src/Application/AdministratorApplication.php:143
9 | Joomla\CMS\Application\AdministratorApplication->dispatch() | JROOT/libraries/src/Application/AdministratorApplication.php:186
10 | Joomla\CMS\Application\AdministratorApplication->doExecute() | JROOT/libraries/src/Application/CMSApplication.php:293
11 | Joomla\CMS\Application\CMSApplication->execute() | JROOT/administrator/includes/app.php:61
12 | require_once() | JROOT/administrator/index.php:32

Expected result

Category recreation from an empty DB-table should work without problems.

Actual result

Category recreation is impossible.

System information

Joomla 4.3.1, PHP 8.2.5

Possible solutions

  1. Comment out line 239 in administrator/components/com_categories/src/View/Category/HtmlView.php >>> Category recreation works without any problems.
  2. Alert user, that at least one main category must be present, make it impossible to delete this category.
  3. Any better solution you propose :)
avatar Freewindrider Freewindrider - open - 3 May 2023
avatar joomla-cms-bot joomla-cms-bot - change - 3 May 2023
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 3 May 2023
avatar richard67 richard67 - change - 3 May 2023
Labels Added: bug
avatar richard67 richard67 - labeled - 3 May 2023
avatar Fedik
Fedik - comment - 3 May 2023

Can you please test #40484 I suspect it should fix the bug.

avatar Freewindrider
Freewindrider - comment - 3 May 2023

Tested this successfully, this was point 3 (a better solution). Thank you very much.

avatar Freewindrider
Freewindrider - comment - 3 May 2023

Fixed in #40484

avatar Freewindrider Freewindrider - close - 3 May 2023
avatar Freewindrider Freewindrider - change - 3 May 2023
Status New Closed
Closed_Date 0000-00-00 00:00:00 2023-05-03 07:58:51
Closed_By Freewindrider

Add a Comment

Login with GitHub to post a comment