diff --git a/administrator/components/com_actionlogs/src/Model/ActionlogModel.php b/administrator/components/com_actionlogs/src/Model/ActionlogModel.php index 8cbbbe2729a4..a6b29c00e61e 100644 --- a/administrator/components/com_actionlogs/src/Model/ActionlogModel.php +++ b/administrator/components/com_actionlogs/src/Model/ActionlogModel.php @@ -126,7 +126,7 @@ protected function sendNotificationEmails($messages, $username, $context) $query = $db->getQuery(true); $query - ->select($db->quoteName(['u.email', 'u.username', 'l.extensions', 'l.exclude_self'])) + ->select($db->quoteName(['u.email', 'u.username', 'l.extensions'])) ->from($db->quoteName('#__users', 'u')) ->where($db->quoteName('u.block') . ' = 0') ->join( @@ -142,7 +142,7 @@ protected function sendNotificationEmails($messages, $username, $context) $recipients = []; foreach ($users as $user) { - if ($user->username === $this->getCurrentUser()->username && $user->exclude_self) { + if ($user->username === $this->getCurrentUser()->username) { continue; } diff --git a/administrator/components/com_admin/sql/updates/mysql/5.3.0-2024-12-19.sql b/administrator/components/com_admin/sql/updates/mysql/5.3.0-2024-12-19.sql index e988a01cbd22..29dc138eddac 100644 --- a/administrator/components/com_admin/sql/updates/mysql/5.3.0-2024-12-19.sql +++ b/administrator/components/com_admin/sql/updates/mysql/5.3.0-2024-12-19.sql @@ -1 +1,6 @@ -ALTER TABLE `#__action_logs_users` ADD COLUMN `exclude_self` tinyint NOT NULL DEFAULT 0; \ No newline at end of file +-- -------------------------------------------------------- +-- The following statement which was introduced with 5.3.0-alpha3 +-- has been disabled as it was reverted with 5.3.0-beta1. +-- See https://github.com/joomla/joomla-cms/pull/44846 for details. +-- +-- ALTER TABLE `#__action_logs_users` ADD COLUMN `exclude_self` tinyint NOT NULL DEFAULT 0; diff --git a/administrator/components/com_admin/sql/updates/mysql/5.3.0-2025-02-09.sql b/administrator/components/com_admin/sql/updates/mysql/5.3.0-2025-02-09.sql new file mode 100644 index 000000000000..55ae2550444f --- /dev/null +++ b/administrator/components/com_admin/sql/updates/mysql/5.3.0-2025-02-09.sql @@ -0,0 +1 @@ +ALTER TABLE `#__action_logs_users` DROP COLUMN `exclude_self` /** CAN FAIL **/; diff --git a/administrator/components/com_admin/sql/updates/postgresql/5.3.0-2024-12-19.sql b/administrator/components/com_admin/sql/updates/postgresql/5.3.0-2024-12-19.sql index ce6d1a46cffc..b09449bfb56f 100644 --- a/administrator/components/com_admin/sql/updates/postgresql/5.3.0-2024-12-19.sql +++ b/administrator/components/com_admin/sql/updates/postgresql/5.3.0-2024-12-19.sql @@ -1 +1,6 @@ -ALTER TABLE "#__action_logs_users" ADD COLUMN "exclude_self" integer DEFAULT 0 NOT NULL; \ No newline at end of file +-- -------------------------------------------------------- +-- The following statement which was introduced with 5.3.0-alpha3 +-- has been disabled as it was reverted with 5.3.0-beta1. +-- See https://github.com/joomla/joomla-cms/pull/44846 for details. +-- +-- ALTER TABLE "#__action_logs_users" ADD COLUMN "exclude_self" integer DEFAULT 0 NOT NULL; diff --git a/administrator/components/com_admin/sql/updates/postgresql/5.3.0-2025-02-09.sql b/administrator/components/com_admin/sql/updates/postgresql/5.3.0-2025-02-09.sql new file mode 100644 index 000000000000..b169f6a493fc --- /dev/null +++ b/administrator/components/com_admin/sql/updates/postgresql/5.3.0-2025-02-09.sql @@ -0,0 +1 @@ +ALTER TABLE "#__action_logs_users" DROP COLUMN "exclude_self" /** CAN FAIL **/; diff --git a/administrator/language/en-GB/plg_system_actionlogs.ini b/administrator/language/en-GB/plg_system_actionlogs.ini index dc6a833285cc..1f0ec95576f5 100644 --- a/administrator/language/en-GB/plg_system_actionlogs.ini +++ b/administrator/language/en-GB/plg_system_actionlogs.ini @@ -10,7 +10,6 @@ PLG_SYSTEM_ACTIONLOGS_INFO_LABEL="Information" PLG_SYSTEM_ACTIONLOGS_JOOMLA_ACTIONLOG_DISABLED="Action Log - Joomla" PLG_SYSTEM_ACTIONLOGS_JOOMLA_ACTIONLOG_DISABLED_REDIRECT="The %s plugin is disabled." PLG_SYSTEM_ACTIONLOGS_NOTIFICATIONS="Email Notifications" -PLG_SYSTEM_ACTIONLOGS_NOTIFICATIONS_EXCLUDE="Exclude Self" PLG_SYSTEM_ACTIONLOGS_OPTIONS="User Actions Log Options" PLG_SYSTEM_ACTIONLOGS_XML_DESCRIPTION="Records the actions of users on the site so they can be reviewed if required." ; Common content type log messages diff --git a/installation/sql/mysql/extensions.sql b/installation/sql/mysql/extensions.sql index e8b98d7cbf0d..0686a3a74649 100644 --- a/installation/sql/mysql/extensions.sql +++ b/installation/sql/mysql/extensions.sql @@ -887,7 +887,6 @@ CREATE TABLE IF NOT EXISTS `#__action_logs_users` ( `user_id` int UNSIGNED NOT NULL, `notify` tinyint UNSIGNED NOT NULL, `extensions` text NOT NULL, - `exclude_self` tinyint UNSIGNED NOT NULL DEFAULT 0, PRIMARY KEY (`user_id`), KEY `idx_notify` (`notify`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci; diff --git a/installation/sql/postgresql/extensions.sql b/installation/sql/postgresql/extensions.sql index ee61578bfe5a..6271c6cf4dbd 100644 --- a/installation/sql/postgresql/extensions.sql +++ b/installation/sql/postgresql/extensions.sql @@ -848,7 +848,6 @@ CREATE TABLE "#__action_logs_users" ( "user_id" integer NOT NULL, "notify" integer NOT NULL, "extensions" text NOT NULL, - "exclude_self" integer NOT NULL DEFAULT 0, PRIMARY KEY ("user_id") ); diff --git a/plugins/system/actionlogs/forms/actionlogs.xml b/plugins/system/actionlogs/forms/actionlogs.xml index ab7def803a2d..07840b824ed0 100644 --- a/plugins/system/actionlogs/forms/actionlogs.xml +++ b/plugins/system/actionlogs/forms/actionlogs.xml @@ -24,18 +24,6 @@ showon="actionlogsNotify:1" default="com_content" /> - - - - diff --git a/plugins/system/actionlogs/src/Extension/ActionLogs.php b/plugins/system/actionlogs/src/Extension/ActionLogs.php index 2b1e9f1bd099..48aab0e12d70 100644 --- a/plugins/system/actionlogs/src/Extension/ActionLogs.php +++ b/plugins/system/actionlogs/src/Extension/ActionLogs.php @@ -175,7 +175,7 @@ public function onContentPrepareData(Model\PrepareDataEvent $event): void $id = (int) $data->id; $query = $db->getQuery(true) - ->select($db->quoteName(['notify', 'extensions', 'exclude_self'])) + ->select($db->quoteName(['notify', 'extensions'])) ->from($db->quoteName('#__action_logs_users')) ->where($db->quoteName('user_id') . ' = :userid') ->bind(':userid', $id, ParameterType::INTEGER); @@ -193,10 +193,9 @@ public function onContentPrepareData(Model\PrepareDataEvent $event): void // Load plugin language files. $this->loadLanguage(); - $data->actionlogs = new \stdClass(); - $data->actionlogs->actionlogsNotify = $values->notify; - $data->actionlogs->actionlogsExtensions = $values->extensions; - $data->actionlogs->actionlogsExcludeSelf = $values->exclude_self; + $data->actionlogs = new \stdClass(); + $data->actionlogs->actionlogsNotify = $values->notify; + $data->actionlogs->actionlogsExtensions = $values->extensions; if (!HTMLHelper::isRegistered('users.actionlogsNotify')) { HTMLHelper::register('users.actionlogsNotify', [__CLASS__, 'renderActionlogsNotify']); @@ -205,10 +204,6 @@ public function onContentPrepareData(Model\PrepareDataEvent $event): void if (!HTMLHelper::isRegistered('users.actionlogsExtensions')) { HTMLHelper::register('users.actionlogsExtensions', [__CLASS__, 'renderActionlogsExtensions']); } - - if (!HTMLHelper::isRegistered('users.actionlogsExcludeSelf')) { - HTMLHelper::register('users.actionlogsExcludeSelf', [__CLASS__, 'renderActionlogsExcludeSelf']); - } } /** @@ -253,10 +248,9 @@ public function onUserAfterSave(User\AfterSaveEvent $event): void // If preferences don't exist, insert. if (!$exists && $authorised && isset($user['actionlogs'])) { $notify = (int) $user['actionlogs']['actionlogsNotify']; - $exclude = (int) $user['actionlogs']['actionlogsExcludeSelf']; - $values = [':userid', ':notify', ':exclude']; - $bind = [$userid, $notify, $exclude]; - $columns = ['user_id', 'notify', 'exclude_self']; + $values = [':userid', ':notify']; + $bind = [$userid, $notify]; + $columns = ['user_id', 'notify']; $query->bind($values, $bind, ParameterType::INTEGER); @@ -277,11 +271,6 @@ public function onUserAfterSave(User\AfterSaveEvent $event): void $query->bind(':notify', $notify, ParameterType::INTEGER); - $exclude = (int) $user['actionlogs']['actionlogsExcludeSelf']; - $values[] = $db->quoteName('exclude_self') . ' = :exclude'; - - $query->bind(':exclude', $exclude, ParameterType::INTEGER); - if (isset($user['actionlogs']['actionlogsExtensions'])) { $values[] = $db->quoteName('extensions') . ' = :extension'; $extension = json_encode($user['actionlogs']['actionlogsExtensions']); @@ -355,20 +344,6 @@ public static function renderActionlogsNotify($value) return Text::_($value ? 'JYES' : 'JNO'); } - /** - * Method to render a value. - * - * @param integer|string $value The value (0 or 1). - * - * @return string The rendered value. - * - * @since 5.3.0 - */ - public static function renderActionlogsExcludeSelf($value) - { - return Text::_($value ? 'JYES' : 'JNO'); - } - /** * Method to render a list of extensions. * @@ -419,7 +394,7 @@ public function onExtensionAfterSave(Model\AfterSaveEvent $event): void $db = $this->getDatabase(); $query = $db->getQuery(true) - ->select($db->quoteName(['user_id', 'notify', 'extensions', 'exclude_self'])) + ->select($db->quoteName(['user_id', 'notify', 'extensions'])) ->from($db->quoteName('#__action_logs_users')); try {