From c4436992808c5a80f49d8270c2d6a2ac5f29bee7 Mon Sep 17 00:00:00 2001 From: Jonathan Miller <230051081+jmiller-moko@users.noreply.github.com> Date: Tue, 7 Apr 2026 14:58:15 -0500 Subject: [PATCH] feat: register action log config for proper display formatting Add #__action_log_config entry so MokoWaaS emergency access events display with proper type title and text prefix in System > Action Logs. Both #__action_logs_extensions and #__action_log_config are cleaned up on uninstall. Co-Authored-By: Claude Opus 4.6 (1M context) --- src/script.php | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/src/script.php b/src/script.php index 561bd3a0..a20107fc 100644 --- a/src/script.php +++ b/src/script.php @@ -468,6 +468,29 @@ class plgSystemMokoWaaSInstallerScript implements InstallerScriptInterface Factory::getApplication()->enqueueMessage( 'Registered MokoWaaS in Action Logs.', 'message' ); + + // Register content type config for display formatting + $configQuery = $db->getQuery(true) + ->select('COUNT(*)') + ->from($db->quoteName('#__action_log_config')) + ->where($db->quoteName('type_alias') . ' = ' + . $db->quote('plg_system_mokowaas')); + + $db->setQuery($configQuery); + + if ((int) $db->loadResult() === 0) + { + $config = (object) [ + 'type_title' => 'MokoWaaS', + 'type_alias' => 'plg_system_mokowaas', + 'id_holder' => '', + 'title_holder' => '', + 'table_name' => '', + 'text_prefix' => 'PLG_SYSTEM_MOKOWAAS', + ]; + + $db->insertObject('#__action_log_config', $config); + } } /** @@ -480,6 +503,7 @@ class plgSystemMokoWaaSInstallerScript implements InstallerScriptInterface private function unregisterActionLogExtension() { $db = Factory::getDbo(); + $db->setQuery( $db->getQuery(true) ->delete($db->quoteName('#__action_logs_extensions')) @@ -487,6 +511,14 @@ class plgSystemMokoWaaSInstallerScript implements InstallerScriptInterface . $db->quote('plg_system_mokowaas')) ); $db->execute(); + + $db->setQuery( + $db->getQuery(true) + ->delete($db->quoteName('#__action_log_config')) + ->where($db->quoteName('type_alias') . ' = ' + . $db->quote('plg_system_mokowaas')) + ); + $db->execute(); } /**