- Hits: 4580
- 13 Comments
- Subscribe to updates
- Bookmark
Reported problem with Joomla! 1.7 upgrade - Fatal error: Cannot instantiate abstract class JDatabaseQuery
We came across a problem when updating one of our Joomla! 1.6 sites to 1.7, which relates to Joomlart templates.
Thanks to John47 for his post on the Joomla! forums which identified a fix for this issue:
This is a problem with Joomlart templates, causing the following error:Fatal error: Cannot instantiate abstract class JDatabaseQuery in mysite/plugins/system/jat3/jat3/core/joomla/modulehelper.php on line 292
and can be resolved by amending the following:
Change the code in the modulehelper.php file
yoursite/plugins/system/jat3/jat3/core/joomla/modulehelper.php
The problem code is on line 292
$Itemid = JRequest::getInt('Itemid');
$app = JFactory::getApplication();
$user = JFactory::getUser();
$groups = implode(',', $user->getAuthorisedViewLevels());
$db = JFactory::getDbo();
jimport("joomla.database.databasequery");
// comment out the line below
// $query = new JDatabaseQuery;
// add the line below
$query = $db->getQuery(true);
$query->select('id, title, module, position, content, showtitle, params, mm.menuid');
$query->from('#__modules AS m');
$query->join('LEFT','#__modules_menu AS mm ON mm.moduleid = m.id');
$query->where('m.published = 1');
Comments
We didn't need to apply Adam's suggestion on any of our JA templated sites, perhaps it relates to an older version of the framework or one particular template?
Ruth
Louigi: No problem, it's the kind of thing that usually takes us ages to figure out so we always write a blog post about it to shorten that timeframe for others! Actually it was John47 on the Joomla! forums who came up with the solution so make sure you thank him too!!!
Ruth

Also had to apply same update to base.class.php located in
yoursite/plugins/system/jat3/jat3/core/menu/