Skip to content
44 changes: 44 additions & 0 deletions administrator/components/com_admin/script.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ protected function updateDatabase()
}

$this->uninstallEosPlugin();
$this->removeJedUpdateserver();
}

/**
Expand Down Expand Up @@ -202,6 +203,49 @@ protected function uninstallEosPlugin()
$installer->uninstall('plugin', $id);
}

/**
* Remove the never used JED Updateserver
*
* @return void
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

misses __DEPLOY_VERSION__

*
* @since __DEPLOY_VERSION__
*/
protected function removeJedUpdateserver()
{
$db = JFactory::getDbo();

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($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($db->quoteName('update_site_id') . ' = ' . $id)
)->execute();
}
catch (Exception $e)
{
echo JText::sprintf('JLIB_DATABASE_ERROR_FUNCTION_FAILED', $e->getCode(), $e->getMessage()) . '<br />';

return;
}
}

/**
* Update the manifest caches
*
Expand Down
1 change: 0 additions & 1 deletion administrator/manifests/files/joomla.xml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,5 @@

<updateservers>
<server name="Joomla! Core" type="collection">https://update.joomla.org/core/list.xml</server>
<server name="Joomla! Extension Directory" type="collection">https://update.joomla.org/jed/list.xml</server>
</updateservers>
</extension>
10 changes: 4 additions & 6 deletions installation/sql/mysql/joomla.sql
Original file line number Diff line number Diff line change
Expand Up @@ -1894,9 +1894,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);

-- --------------------------------------------------------

Expand All @@ -1916,9 +1915,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);

-- --------------------------------------------------------

Expand Down
12 changes: 5 additions & 7 deletions installation/sql/postgresql/joomla.sql
Original file line number Diff line number Diff line change
Expand Up @@ -1782,11 +1782,10 @@ 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);
SELECT setval('#__update_sites_update_site_id_seq', 4, false);

--
-- Table: #__update_sites_extensions
Expand All @@ -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
Expand Down
12 changes: 4 additions & 8 deletions installation/sql/sqlazure/joomla.sql
Original file line number Diff line number Diff line change
Expand Up @@ -2855,11 +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 2, 'Joomla! Extension Directory', 'collection', 'https://update.joomla.org/jed/list.xml', 1, 0
SELECT 2, 'Accredited Joomla! Translations', 'collection', 'https://update.joomla.org/language/translationlist_3.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;
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;

Expand All @@ -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;
Expand Down
3 changes: 1 addition & 2 deletions tests/unit/stubs/database/jos_update_sites.csv
Original file line number Diff line number Diff line change
@@ -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'
3 changes: 1 addition & 2 deletions tests/unit/stubs/database/jos_update_sites_extensions.csv
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
'update_site_id','extension_id'
'1','700'
'2','700'
'3','600'
'2','600'