From ac8a64c4c1781939cf6f2174a061a08feadf2168 Mon Sep 17 00:00:00 2001 From: Jonathan Miller Date: Tue, 23 Jun 2026 11:44:55 -0500 Subject: [PATCH] fix: license key warning no longer shows during uninstall Check if com_mokosuitecross is still in #__extensions before warning about missing license key. Prevents the warning from firing during package uninstall when the update site row is already deleted. --- CHANGELOG.md | 1 + .../src/Extension/MokoSuiteCross.php | 13 +++++++++++++ 2 files changed, 14 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 402b40d8..d76f1472 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -31,6 +31,7 @@ - **Medium**: Fixed getUserId() returning array instead of string on error - **Bluesky**: Replaced md5() with hash('sha256', ...) for cache key - **ServiceController**: Exception details no longer exposed to client +- **License warning**: No longer shows during extension uninstall when component is being removed ## [01.04.01] --- 2026-06-21 diff --git a/source/packages/plg_system_mokosuitecross/src/Extension/MokoSuiteCross.php b/source/packages/plg_system_mokosuitecross/src/Extension/MokoSuiteCross.php index 44626b52..2c94b8e3 100644 --- a/source/packages/plg_system_mokosuitecross/src/Extension/MokoSuiteCross.php +++ b/source/packages/plg_system_mokosuitecross/src/Extension/MokoSuiteCross.php @@ -117,6 +117,19 @@ class MokoSuiteCross extends CMSPlugin implements SubscriberInterface try { $db = Factory::getDbo(); + // Don't warn if the component is not installed (e.g. during uninstall) + $componentExists = $db->setQuery( + $db->getQuery(true) + ->select('COUNT(*)') + ->from($db->quoteName('#__extensions')) + ->where($db->quoteName('type') . ' = ' . $db->quote('component')) + ->where($db->quoteName('element') . ' = ' . $db->quote('com_mokosuitecross')) + )->loadResult(); + + if (!$componentExists) { + return; + } + $query = $db->getQuery(true) ->select($db->quoteName('extra_query')) ->from($db->quoteName('#__update_sites'))