diff --git a/source/script.php b/source/script.php index 3a4a6dbe..5b9d10f7 100644 --- a/source/script.php +++ b/source/script.php @@ -45,6 +45,20 @@ class Pkg_MokosuiteclientInstallerScript public function preflight($type, $parent) { $this->saveDownloadKey(); + + // Remove DEFAULT '' from element column — a previous version set this + // which caused Joomla to install plugin files to the group root + try + { + $db = Factory::getDbo(); + $db->setQuery("ALTER TABLE " . $db->quoteName('#__extensions') + . " MODIFY " . $db->quoteName('element') . " VARCHAR(100) NOT NULL"); + $db->execute(); + } + catch (\Throwable $e) + { + // Non-fatal — column may already be correct + } } public function postflight($type, $parent)