diff --git a/administrator/components/com_cck/install/install.sql b/administrator/components/com_cck/install/install.sql index 587b59bc1..065b7a9f4 100644 --- a/administrator/components/com_cck/install/install.sql +++ b/administrator/components/com_cck/install/install.sql @@ -1700,9 +1700,3 @@ CREATE TABLE IF NOT EXISTS `#__cck_store_item_users` ( `company_vat_id` varchar(255) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci; - - --- -------------------------------------------------------- - - -INSERT IGNORE INTO `#__action_logs_extensions` (`extension`) VALUES ('com_cck'); diff --git a/administrator/components/com_cck/install/upgrades/3.17.1.sql b/administrator/components/com_cck/install/upgrades/3.17.1.sql deleted file mode 100644 index f9266241d..000000000 --- a/administrator/components/com_cck/install/upgrades/3.17.1.sql +++ /dev/null @@ -1,2 +0,0 @@ - -INSERT IGNORE INTO `#__action_logs_extensions` (`extension`) VALUES ('com_cck'); \ No newline at end of file diff --git a/plugins/content/cck/script.php b/plugins/content/cck/script.php index 3eacd65e3..b9bfadd4e 100644 --- a/plugins/content/cck/script.php +++ b/plugins/content/cck/script.php @@ -327,6 +327,10 @@ public function postflight( $type, $parent ) $db->setQuery( 'UPDATE #__extensions SET params = "'.$db->escape( $params ).'" WHERE name = "com_cck"' ); $db->execute(); + + // Set User Actions Log + self::_setUserActionsLog(); + // Set Utf8mb4 flag self::_setUtf8mb4( $params ); } else { @@ -629,6 +633,9 @@ public function postflight( $type, $parent ) } } + // Set User Actions Log + self::_setUserActionsLog(); + // Convert Tables To Utf8mb4 self::_convertTablesToUtf8mb4(); @@ -859,6 +866,25 @@ protected function _forceAutoIncrements() } } + // _setUserActionsLog + protected function _setUserActionsLog() + { + $db = JFactory::getDbo(); + $db_prefix = JFactory::getConfig()->get( 'dbprefix' ); + $table_name = $db_prefix.'action_logs_extensions'; + $tables = $db->getTableList(); + $tables = array_flip( $tables ); + + if ( isset( $tables[$table_name] ) ) { + $db->setQuery( 'SELECT COUNT(id) FROM `#__action_logs_extensions` WHERE extension = "com_cck"' ); + + if ( (int)$db->loadResult() == 0 ) { + $db->setQuery( 'INSERT IGNORE INTO `#__action_logs_extensions` (`extension`) VALUES ("com_cck")' ); + $db->execute(); + } + } + } + // _setUtf8mb4 protected function _setUtf8mb4( $params ) {