feat: auto-enable plugin on first install

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-07 15:00:47 -05:00
parent c443699280
commit 9a0de228ea
+15
View File
@@ -142,6 +142,21 @@ class plgSystemMokoWaaSInstallerScript implements InstallerScriptInterface
*/
public function install(InstallerAdapter $adapter): bool
{
// Auto-enable the plugin on first install
$db = Factory::getDbo();
$db->setQuery(
$db->getQuery(true)
->update($db->quoteName('#__extensions'))
->set($db->quoteName('enabled') . ' = 1')
->where($db->quoteName('element') . ' = '
. $db->quote('mokowaas'))
->where($db->quoteName('folder') . ' = '
. $db->quote('system'))
->where($db->quoteName('type') . ' = '
. $db->quote('plugin'))
);
$db->execute();
return true;
}