In Joomla many extensions rely on system’s core category function and will stop working or throw errors at you in case said Joomla’s category system isn’t working properly. Some of the extensions affected by this problem are HWD Media Share and Classified Ads but there could certainly be more of them.

Extensions will usually display very non descriptive errors, either throwing error 500 or some kind of error code. In other cases they will just show the usual error notification bar without any description of the problem, other than Joomla’s default “there has been an error” message.

Only when you get to Joomla’s own category section can you get more details, pointing you in right direction. It took me a couple of tries and some thinking and digging, but eventually I went to the core of almost every problem of this sort – the database. Here’s what’s been happening to me.

The Problem

When I tried to create a category in HWD Media Share extension, I got the empty error warning. From the URL structure and queries used there I realized HWD was using Joomla’s core content categories, so I went there and tried creating a category. Another error popped up and this got me thinking. I reinstalled Joomla, but that did not solve this problem. I was unable to create any kind of category. When I clicked on “Rebuild” button in Joomla content category page, I got “Failed rebuilding Categories tree data” error. This is when I went to check on database.

Categories table in database was completely empty, so I thought I should maybe “reset” things by adding a dummy category through phpMyadmin. What I didn’t know is Joomla has a default (ROOT) category built in by default and for me this category was missing. I realized that when I opened another Joomla website’s database and saw this category nested above all others.

The Fix

What I did next is obvious. I simply used “Insert” in category table “jos_categories” (your prefix may be different) and copied field values from the other, working, Joomla database for this particular ROOT category.

Here are the values I used (I only edited these fields).

id: 1
asset_id: 0
parent_id: 0
extension: system
title: ROOT
alias: root
published: 1
access: 1
params: {}
metadata: {}
created_user_id: 62   # change into your admin user ID
language: *

 

This is the query I used:

 

INSERT INTO `jos_categories` (`id`, `asset_id`, `parent_id`, `lft`, `rgt`, `level`, `path`, `extension`, `title`, `alias`, `note`, `description`, `published`, `checked_out`, `checked_out_time`, `access`, `params`, `metadesc`, `metakey`, `metadata`, `created_user_id`, `created_time`, `modified_user_id`, `modified_time`, `hits`, `language`, `version`) VALUES ('1', '0', '0', '0', '0', '1', '', 'system', 'ROOT', 'root', '', '', '1', '0', '0000-00-00 00:00:00.000000', '0', '{}', '', '', '{}', '62', '0000-00-00 00:00:00.000000', '0', '0000-00-00 00:00:00.000000', '0', '*', '1');

 

Make sure to change table name prefix from “jos” into whatever your prefix is. Also change user ID number (62 in this case) to reflect administrator’s user ID on your site.

 

Note this was done on a system with no categories at all. If you do have categories present and still receive similar errors, try using “Rebuild” button, or take a look in “jom_categories” table to see if you have a category with “parent_id” = 0 present. If not, creating one through phpMyadmin could solve your problem.