Upgrading to Joomla4

The next error we are getting seems to be more serious. It refers to a missing databse table, what, how, why???? Specifically, the Back End is referring to a missing 500 Table '3d2.ar_workflow_associations' that doesn't exist. Now, this is interesting since we would assume that only errors related to extensions will be present but right now an error for missing tables is bothering us. The only thing we can do now is to log in phpMyAdmin and try to verify if the _workflow_associations table exists or not.

500 Table '3d2.ar_workflow_associations' doesn't exist

In my case, the table doesn't exist so let's create it. Please, make sure you will back up as you are proceeding, otherwise, you can end up with a broken site with no turnback. If you are sure you want to proceed, let's create the tables that are missing. The first one is already mentioned 3d2.ar_workflow_associations. The 3d2 is the database, and ar_ is the prefix. This can be different in your case, change this to your database setup. The following SQL queries will run the creation of the tables as listed below:

  • 3d2.ar_workflow_associations
  • 3d2.ar_workflow_stages
  • 3d2.ar_workflows
CREATE TABLE `ar_workflow_associations` (
  `item_id` int(11) NOT NULL DEFAULT 0 COMMENT 'Extension table id value',
  `stage_id` int(11) NOT NULL COMMENT 'Foreign Key to #__workflow_stages.id',
  `extension` varchar(50) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
CREATE TABLE `ar_workflow_stages` (
  `id` int(11) NOT NULL,
  `asset_id` int(11) DEFAULT 0,
  `ordering` int(11) NOT NULL DEFAULT 0,
  `workflow_id` int(11) NOT NULL,
  `published` tinyint(4) NOT NULL DEFAULT 0,
  `title` varchar(255) NOT NULL,
  `description` text NOT NULL,
  `default` tinyint(4) NOT NULL DEFAULT 0,
  `checked_out_time` datetime DEFAULT NULL,
  `checked_out` int(10) UNSIGNED DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
CREATE TABLE `ar_workflows` (
  `id` int(11) NOT NULL,
  `asset_id` int(11) DEFAULT 0,
  `published` tinyint(4) NOT NULL DEFAULT 0,
  `title` varchar(255) NOT NULL,
  `description` text NOT NULL,
  `extension` varchar(50) NOT NULL,
  `default` tinyint(4) NOT NULL DEFAULT 0,
  `ordering` int(11) NOT NULL DEFAULT 0,
  `created` datetime NOT NULL,
  `created_by` int(11) NOT NULL DEFAULT 0,
  `modified` datetime NOT NULL,
  `modified_by` int(11) NOT NULL DEFAULT 0,
  `checked_out_time` datetime DEFAULT NULL,
  `checked_out` int(10) UNSIGNED DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

The next error is again database related 500 Unknown column 'fp.featured_up' in 'field list'. This means that we are missing some columns in ar_content_frontpage table. Well, let's add them since it refers to featured_up we can guess that featured_down will be missing as well. The queries below will add them one by one. After fixing this, I am back to "normal" errors like 0 Call to undefined method Joomla\CMS\Application\AdministratorApplication::isSite() and since we know how to fix them, let's do it. The error is again referring to  JROOT\plugins\system\yjsg\yjsg.php:984 and thus YJSG plugin.

ALTER TABLE `ar_content_frontpage` ADD `featured_up` DATETIME;
ALTER TABLE `ar_content_frontpage` ADD `featured_down` DATETIME;

The next error I got is not from the YJSG plugin but from the Attachment extension. The error simply states 0 Class "JRequest" not found. Looking at the line of code and reading something about JRequest and Joomla 4 you will find out that  JRequest is deprecated. You can see that you need to fetch a variable and then replace the code with something like below.

$task = JRequest::getCmd('task');
#change to
$jinput = JFactory::getApplication()->input;
$task = $jinput->get('task');

Popular