From b21d9d6510b26692bd366688544664c1e56c7de0 Mon Sep 17 00:00:00 2001 From: zero-24 Date: Tue, 29 Nov 2016 17:40:28 +0100 Subject: [PATCH 01/11] Update joomla.sql --- installation/sql/mysql/joomla.sql | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/installation/sql/mysql/joomla.sql b/installation/sql/mysql/joomla.sql index 672d6f48d5bee..f117ee95a25e5 100644 --- a/installation/sql/mysql/joomla.sql +++ b/installation/sql/mysql/joomla.sql @@ -1861,9 +1861,8 @@ CREATE TABLE IF NOT EXISTS `#__update_sites` ( INSERT INTO `#__update_sites` (`update_site_id`, `name`, `type`, `location`, `enabled`, `last_check_timestamp`) VALUES (1, 'Joomla! Core', 'collection', 'https://update.joomla.org/core/list.xml', 1, 0), -(2, 'Joomla! Extension Directory', 'collection', 'https://update.joomla.org/jed/list.xml', 1, 0), -(3, 'Accredited Joomla! Translations', 'collection', 'https://update.joomla.org/language/translationlist_3.xml', 1, 0), -(4, 'Joomla! Update Component Update Site', 'extension', 'https://update.joomla.org/core/extensions/com_joomlaupdate.xml', 1, 0); +(2, 'Accredited Joomla! Translations', 'collection', 'https://update.joomla.org/language/translationlist_3.xml', 1, 0), +(3, 'Joomla! Update Component Update Site', 'extension', 'https://update.joomla.org/core/extensions/com_joomlaupdate.xml', 1, 0); -- -------------------------------------------------------- @@ -1883,9 +1882,8 @@ CREATE TABLE IF NOT EXISTS `#__update_sites_extensions` ( INSERT INTO `#__update_sites_extensions` (`update_site_id`, `extension_id`) VALUES (1, 700), -(2, 700), -(3, 802), -(4, 28); +(2, 802), +(3, 28); -- -------------------------------------------------------- From 56739ee74f9c899e594dc7e9ccbdfb7b977de265 Mon Sep 17 00:00:00 2001 From: zero-24 Date: Tue, 29 Nov 2016 17:40:56 +0100 Subject: [PATCH 02/11] Update joomla.sql --- installation/sql/postgresql/joomla.sql | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/installation/sql/postgresql/joomla.sql b/installation/sql/postgresql/joomla.sql index 03b7c99710596..2f131644d58a1 100644 --- a/installation/sql/postgresql/joomla.sql +++ b/installation/sql/postgresql/joomla.sql @@ -1782,9 +1782,8 @@ COMMENT ON TABLE "#__update_sites" IS 'Update Sites'; -- INSERT INTO "#__update_sites" ("update_site_id", "name", "type", "location", "enabled", "last_check_timestamp") VALUES (1, 'Joomla! Core', 'collection', 'https://update.joomla.org/core/list.xml', 1, 0), -(2, 'Joomla! Extension Directory', 'collection', 'https://update.joomla.org/jed/list.xml', 1, 0), -(3, 'Accredited Joomla! Translations', 'collection', 'https://update.joomla.org/language/translationlist_3.xml', 1, 0), -(4, 'Joomla! Update Component Update Site', 'extension', 'https://update.joomla.org/core/extensions/com_joomlaupdate.xml', 1, 0); +(2, 'Accredited Joomla! Translations', 'collection', 'https://update.joomla.org/language/translationlist_3.xml', 1, 0), +(3, 'Joomla! Update Component Update Site', 'extension', 'https://update.joomla.org/core/extensions/com_joomlaupdate.xml', 1, 0); SELECT setval('#__update_sites_update_site_id_seq', 5, false); @@ -1804,9 +1803,8 @@ COMMENT ON TABLE "#__update_sites_extensions" IS 'Links extensions to update sit -- INSERT INTO "#__update_sites_extensions" ("update_site_id", "extension_id") VALUES (1, 700), -(2, 700), -(3, 802), -(4, 28); +(2, 802), +(3, 28); -- -- Table: #__usergroups From 5c0cce8daefaa9602fb3b8758f4e687a0beabddc Mon Sep 17 00:00:00 2001 From: zero-24 Date: Tue, 29 Nov 2016 17:41:23 +0100 Subject: [PATCH 03/11] Update joomla.sql --- installation/sql/sqlazure/joomla.sql | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/installation/sql/sqlazure/joomla.sql b/installation/sql/sqlazure/joomla.sql index be35af447da34..0bb2f5b96ca42 100644 --- a/installation/sql/sqlazure/joomla.sql +++ b/installation/sql/sqlazure/joomla.sql @@ -2855,8 +2855,6 @@ SET IDENTITY_INSERT [#__update_sites] ON; INSERT INTO [#__update_sites] ([update_site_id], [name], [type], [location], [enabled], [last_check_timestamp]) SELECT 1, 'Joomla! Core', 'collection', 'https://update.joomla.org/core/list.xml', 1, 0 UNION ALL -SELECT 2, 'Joomla! Extension Directory', 'collection', 'https://update.joomla.org/jed/list.xml', 1, 0 -UNION ALL SELECT 3, 'Accredited Joomla! Translations', 'collection', 'https://update.joomla.org/language/translationlist_3.xml', 1, 0 UNION ALL SELECT 4, 'Joomla! Update Component Update Site', 'extension', 'https://update.joomla.org/core/extensions/com_joomlaupdate.xml', 1, 0; @@ -2879,11 +2877,9 @@ CREATE TABLE [#__update_sites_extensions]( INSERT INTO [#__update_sites_extensions] ([update_site_id], [extension_id]) SELECT 1, 700 UNION ALL -SELECT 2, 700 -UNION ALL -SELECT 3, 802 +SELECT 2, 802 UNION ALL -SELECT 4, 28; +SELECT 3, 28; /****** Object: Table [#__updates] ******/ SET QUOTED_IDENTIFIER ON; From bb61b841a444354f66673c36e92e17fa373dcc44 Mon Sep 17 00:00:00 2001 From: zero-24 Date: Wed, 30 Nov 2016 10:39:01 +0100 Subject: [PATCH 04/11] Update joomla.sql --- installation/sql/postgresql/joomla.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/installation/sql/postgresql/joomla.sql b/installation/sql/postgresql/joomla.sql index 2f131644d58a1..309916e425ec7 100644 --- a/installation/sql/postgresql/joomla.sql +++ b/installation/sql/postgresql/joomla.sql @@ -1785,7 +1785,7 @@ INSERT INTO "#__update_sites" ("update_site_id", "name", "type", "location", "en (2, 'Accredited Joomla! Translations', 'collection', 'https://update.joomla.org/language/translationlist_3.xml', 1, 0), (3, 'Joomla! Update Component Update Site', 'extension', 'https://update.joomla.org/core/extensions/com_joomlaupdate.xml', 1, 0); -SELECT setval('#__update_sites_update_site_id_seq', 5, false); +SELECT setval('#__update_sites_update_site_id_seq', 4, false); -- -- Table: #__update_sites_extensions From 2d1a06827ff1faf5a4b30340458f5d482a1290a6 Mon Sep 17 00:00:00 2001 From: zero-24 Date: Wed, 30 Nov 2016 10:40:23 +0100 Subject: [PATCH 05/11] Update joomla.xml --- administrator/manifests/files/joomla.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/administrator/manifests/files/joomla.xml b/administrator/manifests/files/joomla.xml index 9b84fb3a3707c..6345150a8d6c6 100644 --- a/administrator/manifests/files/joomla.xml +++ b/administrator/manifests/files/joomla.xml @@ -48,6 +48,5 @@ https://update.joomla.org/core/list.xml - https://update.joomla.org/jed/list.xml From 28d218dcf94536fa210844e0fc25075617274d6b Mon Sep 17 00:00:00 2001 From: zero-24 Date: Wed, 30 Nov 2016 10:42:07 +0100 Subject: [PATCH 06/11] Update jos_update_sites.csv --- tests/unit/stubs/database/jos_update_sites.csv | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/unit/stubs/database/jos_update_sites.csv b/tests/unit/stubs/database/jos_update_sites.csv index c2bbb9dcdc349..82d57da8235df 100644 --- a/tests/unit/stubs/database/jos_update_sites.csv +++ b/tests/unit/stubs/database/jos_update_sites.csv @@ -1,4 +1,3 @@ 'update_site_id','name','type','location','enabled','last_check_timestamp' '1','Joomla Core','collection','http://update.joomla.org/core/list.xml','1','0' -'2','Joomla Extension Directory','collection','http://update.joomla.org/jed/list.xml','1','0' -'3','Accredited Joomla! Translations','collection','http://update.joomla.org/language/translationlist_3.xml','1','0' +'2','Accredited Joomla! Translations','collection','http://update.joomla.org/language/translationlist_3.xml','1','0' From eae8385a1c540ac58e7500f6216a48fd834b72f5 Mon Sep 17 00:00:00 2001 From: zero-24 Date: Wed, 30 Nov 2016 10:42:43 +0100 Subject: [PATCH 07/11] Update jos_update_sites_extensions.csv --- tests/unit/stubs/database/jos_update_sites_extensions.csv | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/unit/stubs/database/jos_update_sites_extensions.csv b/tests/unit/stubs/database/jos_update_sites_extensions.csv index f80af626aab70..4c8a59005c3c4 100644 --- a/tests/unit/stubs/database/jos_update_sites_extensions.csv +++ b/tests/unit/stubs/database/jos_update_sites_extensions.csv @@ -1,4 +1,3 @@ 'update_site_id','extension_id' '1','700' -'2','700' -'3','600' +'2','600' From 377d8e2545909ca3024f0b5f415c7260eb52ddc6 Mon Sep 17 00:00:00 2001 From: zero-24 Date: Wed, 30 Nov 2016 10:46:38 +0100 Subject: [PATCH 08/11] Update script.php --- administrator/components/com_admin/script.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/administrator/components/com_admin/script.php b/administrator/components/com_admin/script.php index 5c4fc2a73a68d..29a9cb73be74a 100644 --- a/administrator/components/com_admin/script.php +++ b/administrator/components/com_admin/script.php @@ -120,6 +120,7 @@ protected function updateDatabase() } $this->uninstallEosPlugin(); + $this->removeJedUpdateserver(); } /** @@ -202,6 +203,17 @@ protected function uninstallEosPlugin() $installer->uninstall('plugin', $id); } + /** + * Remove the never used JED Updateserver + * + * @return void + */ + protected function removeJedUpdateserver() + { + // Delete the item, from #__update_sites_extensions + // Delete the item from #__update_sites + } + /** * Update the manifest caches * From fa48100dac480f6b5d15884952a9179ba47c8e78 Mon Sep 17 00:00:00 2001 From: zero-24 Date: Wed, 30 Nov 2016 18:28:07 +0100 Subject: [PATCH 09/11] Update script.php --- administrator/components/com_admin/script.php | 25 +++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/administrator/components/com_admin/script.php b/administrator/components/com_admin/script.php index 29a9cb73be74a..371451cbf886a 100644 --- a/administrator/components/com_admin/script.php +++ b/administrator/components/com_admin/script.php @@ -210,8 +210,29 @@ protected function uninstallEosPlugin() */ protected function removeJedUpdateserver() { - // Delete the item, from #__update_sites_extensions - // Delete the item from #__update_sites + $db = JFactory::getDbo(); + + // Get the update site ID of the JED Update server + $id = $db->setQuery( + $db->getQuery(true) + ->select('update_site_id') + ->from($db->quoteName('#__update_sites')) + ->where('location = ' . $db->quote('https://update.joomla.org/jed/list.xml')) + )->loadResult(); + + // Delete from update sites + $result = $db->setQuery( + $db->getQuery(true) + ->delete($db->quoteName('#__update_sites')) + ->where('update_site_id = ' . $id) + )->execute(); + + // Delete from update sites extensions + $result = $db->setQuery( + $db->getQuery(true) + ->delete($db->quoteName('#__update_sites_extensions')) + ->where('update_site_id = ' . $id) + )->execute(); } /** From 1609f50f66b645ad837f61de2bd754e439024db3 Mon Sep 17 00:00:00 2001 From: zero-24 Date: Sun, 4 Dec 2016 18:23:04 +0100 Subject: [PATCH 10/11] Update joomla.sql --- installation/sql/sqlazure/joomla.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/installation/sql/sqlazure/joomla.sql b/installation/sql/sqlazure/joomla.sql index 0bb2f5b96ca42..99596a5c5a263 100644 --- a/installation/sql/sqlazure/joomla.sql +++ b/installation/sql/sqlazure/joomla.sql @@ -2855,9 +2855,9 @@ SET IDENTITY_INSERT [#__update_sites] ON; INSERT INTO [#__update_sites] ([update_site_id], [name], [type], [location], [enabled], [last_check_timestamp]) SELECT 1, 'Joomla! Core', 'collection', 'https://update.joomla.org/core/list.xml', 1, 0 UNION ALL -SELECT 3, 'Accredited Joomla! Translations', 'collection', 'https://update.joomla.org/language/translationlist_3.xml', 1, 0 +SELECT 2, 'Accredited Joomla! Translations', 'collection', 'https://update.joomla.org/language/translationlist_3.xml', 1, 0 UNION ALL -SELECT 4, 'Joomla! Update Component Update Site', 'extension', 'https://update.joomla.org/core/extensions/com_joomlaupdate.xml', 1, 0; +SELECT 3, 'Joomla! Update Component Update Site', 'extension', 'https://update.joomla.org/core/extensions/com_joomlaupdate.xml', 1, 0; SET IDENTITY_INSERT [#__update_sites] OFF; From eb6d25669a4a5c6f6081dbee7b3518847dc11de1 Mon Sep 17 00:00:00 2001 From: zero-24 Date: Sun, 4 Dec 2016 18:24:54 +0100 Subject: [PATCH 11/11] Update script.php --- administrator/components/com_admin/script.php | 49 ++++++++++++------- 1 file changed, 30 insertions(+), 19 deletions(-) diff --git a/administrator/components/com_admin/script.php b/administrator/components/com_admin/script.php index 371451cbf886a..43d44cde177e4 100644 --- a/administrator/components/com_admin/script.php +++ b/administrator/components/com_admin/script.php @@ -207,32 +207,43 @@ protected function uninstallEosPlugin() * Remove the never used JED Updateserver * * @return void + * + * @since __DEPLOY_VERSION__ */ protected function removeJedUpdateserver() { $db = JFactory::getDbo(); - // Get the update site ID of the JED Update server - $id = $db->setQuery( - $db->getQuery(true) - ->select('update_site_id') - ->from($db->quoteName('#__update_sites')) - ->where('location = ' . $db->quote('https://update.joomla.org/jed/list.xml')) - )->loadResult(); + try + { + // Get the update site ID of the JED Update server + $id = $db->setQuery( + $db->getQuery(true) + ->select('update_site_id') + ->from($db->quoteName('#__update_sites')) + ->where($db->quoteName('location') . ' = ' . $db->quote('https://update.joomla.org/jed/list.xml')) + )->loadResult(); - // Delete from update sites - $result = $db->setQuery( - $db->getQuery(true) - ->delete($db->quoteName('#__update_sites')) - ->where('update_site_id = ' . $id) - )->execute(); + // Delete from update sites + $result = $db->setQuery( + $db->getQuery(true) + ->delete($db->quoteName('#__update_sites')) + ->where($db->quoteName('update_site_id') . ' = ' . $id) + )->execute(); - // Delete from update sites extensions - $result = $db->setQuery( - $db->getQuery(true) - ->delete($db->quoteName('#__update_sites_extensions')) - ->where('update_site_id = ' . $id) - )->execute(); + // Delete from update sites extensions + $result = $db->setQuery( + $db->getQuery(true) + ->delete($db->quoteName('#__update_sites_extensions')) + ->where($db->quoteName('update_site_id') . ' = ' . $id) + )->execute(); + } + catch (Exception $e) + { + echo JText::sprintf('JLIB_DATABASE_ERROR_FUNCTION_FAILED', $e->getCode(), $e->getMessage()) . '
'; + + return; + } } /**