From bc1a6dcd46bf947f9e534c5131bbdafcbc08eb5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ya=C4=9F=C4=B1zhan=20Burak=20Yakar?= Date: Sat, 30 May 2026 23:07:43 +0300 Subject: [PATCH] Remove leftover Paidsupport and Servicemembership modules (#3690) * Remove leftover Paidsupport and Servicemembership modules * Bump last_patch --- src/install/sql/content.sql | 2 +- src/library/FOSSBilling/UpdatePatcher.php | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/install/sql/content.sql b/src/install/sql/content.sql index 3ea6900de..45b00b6e0 100644 --- a/src/install/sql/content.sql +++ b/src/install/sql/content.sql @@ -303,7 +303,7 @@ LOCK TABLES `setting` WRITE; INSERT INTO `setting` (`id`, `param`, `value`, `public`, `category`, `hash`, `created_at`, `updated_at`) VALUES - (1,'last_patch','65',0,NULL,NULL,'2024-12-30 12:00:00','2024-12-30 12:00:00'), + (1,'last_patch','66',0,NULL,NULL,'2024-12-30 12:00:00','2024-12-30 12:00:00'), (2,'company_name','Company Name',0,NULL,NULL,'2022-12-01 12:00:00','2022-12-01 12:00:00'), (3,'company_email','support@yourcompany.com',0,NULL,NULL,'2022-12-01 12:00:00','2022-12-01 12:00:00'), (4,'company_signature','FOSSBilling.org - Client Management, Invoicing and Support Software',0,NULL,NULL,'2022-12-01 12:00:00','2022-12-01 12:00:00'), diff --git a/src/library/FOSSBilling/UpdatePatcher.php b/src/library/FOSSBilling/UpdatePatcher.php index d7e8e2a89..31e8e5a38 100644 --- a/src/library/FOSSBilling/UpdatePatcher.php +++ b/src/library/FOSSBilling/UpdatePatcher.php @@ -454,6 +454,7 @@ class UpdatePatcher implements InjectionAwareInterface 63 => 'patch63', 64 => 'patch64', 65 => 'patch65', + 66 => 'patch66', ]; ksort($patches, SORT_NATURAL); @@ -1416,6 +1417,20 @@ class UpdatePatcher implements InjectionAwareInterface $this->migrateDownloadableOrderStorageKeys(); } + private function patch66(): void + { + // The original removal/migration patches for these modules only handled their data + // migrations. Installations that already ran those patches need a new patch level + // to clean up stale extension records and module directories left on disk. + $this->executeSql("DELETE FROM extension_meta WHERE extension IN ('mod_paidsupport', 'mod_servicemembership') OR (rel_type = 'mod' AND LOWER(rel_id) IN ('paidsupport', 'servicemembership'))"); + $this->executeSql("DELETE FROM extension WHERE type = 'mod' AND LOWER(name) IN ('paidsupport', 'servicemembership')"); + + $this->executeFileActions([ + Path::join(PATH_MODS, 'Paidsupport') => 'unlink', + Path::join(PATH_MODS, 'Servicemembership') => 'unlink', + ]); + } + private function generateDownloadableStoredFilename(): string { do {