From 9a0de228ea31dd3cb9fda84d3cbedf8763cd8beb Mon Sep 17 00:00:00 2001 From: Jonathan Miller <230051081+jmiller-moko@users.noreply.github.com> Date: Tue, 7 Apr 2026 15:00:47 -0500 Subject: [PATCH] feat: auto-enable plugin on first install Co-Authored-By: Claude Opus 4.6 (1M context) --- src/script.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/script.php b/src/script.php index a20107f..507b0fe 100644 --- a/src/script.php +++ b/src/script.php @@ -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; }