diff --git a/admin/configure.php b/admin/configure.php index afd2b51f6921..752b9534377e 100644 --- a/admin/configure.php +++ b/admin/configure.php @@ -34,7 +34,7 @@ function civicrm_setup() { $adminPath = JPATH_ADMINISTRATOR . DIRECTORY_SEPARATOR . 'components' . DIRECTORY_SEPARATOR . 'com_civicrm'; - $jConfig = JFactory::getConfig(); + $jConfig = new JConfig(); set_time_limit(4000); // Path to the archive @@ -70,7 +70,7 @@ function civicrm_setup() { $db->setQuery(' SELECT count( * ) FROM information_schema.tables WHERE table_name LIKE "civicrm_domain" -AND table_schema = "' . $jConfig->getValue('config.db') . '" '); +AND table_schema = "' . $jConfig->db . '" '); global $civicrmUpgrade; $civicrmUpgrade = ($db->loadResult() == 0) ? FALSE : TRUE; diff --git a/script.civicrm.php b/script.civicrm.php index f31d4e8d2d8a..68bc734aeca7 100644 --- a/script.civicrm.php +++ b/script.civicrm.php @@ -90,6 +90,11 @@ function install($parent) { $installer = new JInstaller(); $plgArray = array(); + // Joomla 3.0 no longer supports DS + if (!defined('DS')) { + define('DS', DIRECTORY_SEPARATOR); + } + foreach ($manifest->plugins->plugin as $plugin) { $attributes = $plugin->attributes(); $plg = $source . DS . $attributes['folder'] . DS . $attributes['plugin']; @@ -98,18 +103,33 @@ function install($parent) { } $db = JFactory::getDbo(); - $tableExtensions = $db->nameQuote("#__extensions"); - $columnElement = $db->nameQuote("element"); - $columnType = $db->nameQuote("type"); - $columnEnabled = $db->nameQuote("enabled"); + + // In joomla 3.0, they decided to change the below name to quoteName + // so we'll do a switch and check which fn name to use + if (method_exists($db, 'nameQuote')) { + $quoteFn = 'nameQuote'; + } + else if (method_exists($db, 'quoteName')) { + $quoteFn = 'quoteName'; + } + else { + echo "Could not determine name of the quote function in Joomla!"; + exit(); + } + + $tableExtensions = $db->$quoteFn("#__extensions"); + $columnElement = $db->$quoteFn("element"); + $columnType = $db->$quoteFn("type"); + $columnEnabled = $db->$quoteFn("enabled"); $plgList = implode(',', $plgArray); // Enable plugins - $db->setQuery("UPDATE $tableExtensions - SET $columnEnabled = 1 - WHERE $columnElement IN ($plgList) - AND $columnType = 'plugin'" - ); + $db->setQuery(" +UPDATE $tableExtensions +SET $columnEnabled = 1 +WHERE $columnElement IN ($plgList) +AND $columnType = 'plugin' +"); $db->query(); echo $content;