From ab21d175633dd61fc6eb613557b2b992a9ec8a3d Mon Sep 17 00:00:00 2001 From: Jonathan Miller Date: Sat, 20 Jun 2026 23:58:39 -0500 Subject: [PATCH] fix(install): skip enablePlugin when plugin files not on disk Prevents enabling plugins whose extension record exists in the DB but whose files were never deployed (e.g. backup bridge when package build fails). Avoids fatal class-not-found errors on next page load. --- source/script.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/source/script.php b/source/script.php index 24dc48d5..25ca982a 100644 --- a/source/script.php +++ b/source/script.php @@ -464,6 +464,16 @@ class Pkg_MokosuiteclientInstallerScript { try { + // Only enable if the plugin files actually exist on disk + $pluginDir = JPATH_PLUGINS . '/' . $group . '/' . $element; + + if (!is_dir($pluginDir)) + { + Log::add('Skipping enable for ' . $group . '/' . $element . ' — files not installed', Log::DEBUG, 'mokosuiteclient'); + + return; + } + $db = Factory::getDbo(); $query = $db->getQuery(true) ->update($db->quoteName('#__extensions'))