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) <noreply@anthropic.com>
This commit is contained in:
2026-04-07 14:58:15 -05:00
parent b1f4c41310
commit c443699280
+32
View File
@@ -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();
}
/**