Skip to content

Commit

Permalink
Solves inconsistency with en-GB language package (#9835)
Browse files Browse the repository at this point in the history
* solves inconsistency with en-GB language package

* use 801 id instead of 650

* fix conflicts

* fix conflicts 2

* change sql to 3.6.0

* update site id is 3
  • Loading branch information
andrepereiradasilva authored and wilsonge committed May 8, 2016
1 parent 68f3f81 commit 4b8f9bb
Show file tree
Hide file tree
Showing 9 changed files with 35 additions and 11 deletions.
2 changes: 1 addition & 1 deletion administrator/components/com_admin/script.php
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ protected function updateManifestCaches()
array('file', 'joomla', '', 0),

// Packages
// None in core at this time
array('package', 'pkg_en-GB', '', 0),
);

// Attempt to refresh manifest caches
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
-- Insert the missing en-GB package extension.
INSERT INTO `#__extensions` (`extension_id`, `name`, `type`, `element`, `folder`, `client_id`, `enabled`, `access`, `protected`, `manifest_cache`, `params`, `custom_data`, `system_data`, `checked_out`, `checked_out_time`, `ordering`, `state`)
VALUES (801, 'English (United Kingdom)', 'package', 'pkg_en-GB', '', 0, 1, 1, 1, '', '', '', '', 0, '0000-00-00 00:00:00', 0, 0);

-- Change update site extension id to the new extension.
UPDATE `#__update_sites_extensions` SET `extension_id` = 801 WHERE `update_site_id` = 3 AND `extension_id` = 600;
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
INSERT INTO "#__extensions" ("extension_id", "name", "type", "element", "folder", "client_id", "enabled", "access", "protected", "manifest_cache", "params", "custom_data", "system_data", "checked_out", "checked_out_time", "ordering", "state") VALUES
(801, 'English (United Kingdom)', 'package', 'pkg_en-GB', '', 0, 1, 1, 1, '', '', '', '', 0, '1970-01-01 00:00:00', 0, 0);

UPDATE "#__update_sites_extensions" SET "extension_id" = 801 WHERE "update_site_id" = 3 AND "extension_id" = 600;
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
SET IDENTITY_INSERT [#__extensions] ON;

INSERT [#__extensions] ([extension_id], [name], [type], [element], [folder], [client_id], [enabled], [access], [protected], [manifest_cache], [params], [custom_data], [system_data], [checked_out], [checked_out_time], [ordering], [state])
SELECT 801, 'English (United Kingdom)', 'package', 'pkg_en-GB', '', 0, 1, 1, 1, '', '', '', '', 0, '1900-01-01 00:00:00', 0, 0;

SET IDENTITY_INSERT [#__extensions] OFF;

UPDATE [#__update_sites_extensions] SET [extension_id] = 801 WHERE [update_site_id] = 3 AND [extension_id] = 600;
6 changes: 2 additions & 4 deletions administrator/components/com_installer/models/languages.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,11 @@ public function __construct($config = array())
// Get the extension_id of the en-GB package.
$db = $this->getDbo();
$extQuery = $db->getQuery(true);
$extType = 'language';
$extElem = 'en-GB';

$extQuery->select($db->quoteName('extension_id'))
->from($db->quoteName('#__extensions'))
->where($db->quoteName('type') . ' = ' . $db->quote($extType))
->where($db->quoteName('element') . ' = ' . $db->quote($extElem))
->where($db->quoteName('type') . ' = ' . $db->quote('package'))
->where($db->quoteName('element') . ' = ' . $db->quote('pkg_en-GB'))
->where($db->quoteName('client_id') . ' = 0');

$db->setQuery($extQuery);
Expand Down
4 changes: 2 additions & 2 deletions installation/model/languages.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ public function getItems()

$extQuery->select($db->qn('extension_id'))
->from($db->qn('#__extensions'))
->where($db->qn('type') . ' = ' . $db->q('language'))
->where($db->qn('element') . ' = ' . $db->q('en-GB'))
->where($db->qn('type') . ' = ' . $db->q('package'))
->where($db->qn('element') . ' = ' . $db->q('pkg_en-GB'))
->where($db->qn('client_id') . ' = 0');

$db->setQuery($extQuery);
Expand Down
5 changes: 3 additions & 2 deletions installation/sql/mysql/joomla.sql
Original file line number Diff line number Diff line change
Expand Up @@ -619,7 +619,8 @@ INSERT INTO `#__extensions` (`extension_id`, `name`, `type`, `element`, `folder`
(507, 'isis', 'template', 'isis', '', 1, 1, 1, 0, '', '{"templateColor":"","logoFile":""}', '', '', 0, '0000-00-00 00:00:00', 0, 0),
(600, 'English (United Kingdom)', 'language', 'en-GB', '', 0, 1, 1, 1, '', '', '', '', 0, '0000-00-00 00:00:00', 0, 0),
(601, 'English (United Kingdom)', 'language', 'en-GB', '', 1, 1, 1, 1, '', '', '', '', 0, '0000-00-00 00:00:00', 0, 0),
(700, 'files_joomla', 'file', 'joomla', '', 0, 1, 1, 1, '', '', '', '', 0, '0000-00-00 00:00:00', 0, 0);
(700, 'files_joomla', 'file', 'joomla', '', 0, 1, 1, 1, '', '', '', '', 0, '0000-00-00 00:00:00', 0, 0),
(801, 'English (United Kingdom)', 'package', 'pkg_en-GB', '', 0, 1, 1, 1, '', '', '', '', 0, '0000-00-00 00:00:00', 0, 0);

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

Expand Down Expand Up @@ -1811,7 +1812,7 @@ CREATE TABLE IF NOT EXISTS `#__update_sites_extensions` (
INSERT INTO `#__update_sites_extensions` (`update_site_id`, `extension_id`) VALUES
(1, 700),
(2, 700),
(3, 600),
(3, 801),
(4, 28);

-- --------------------------------------------------------
Expand Down
6 changes: 5 additions & 1 deletion installation/sql/postgresql/joomla.sql
Original file line number Diff line number Diff line change
Expand Up @@ -630,6 +630,10 @@ INSERT INTO "#__extensions" ("extension_id", "name", "type", "element", "folder"
INSERT INTO "#__extensions" ("extension_id", "name", "type", "element", "folder", "client_id", "enabled", "access", "protected", "manifest_cache", "params", "custom_data", "system_data", "checked_out", "checked_out_time", "ordering", "state") VALUES
(700, 'files_joomla', 'file', 'joomla', '', 0, 1, 1, 1, '', '', '', '', 0, '1970-01-01 00:00:00', 0, 0);

-- Packages
INSERT INTO "#__extensions" ("extension_id", "name", "type", "element", "folder", "client_id", "enabled", "access", "protected", "manifest_cache", "params", "custom_data", "system_data", "checked_out", "checked_out_time", "ordering", "state") VALUES
(801, 'English (United Kingdom)', 'package', 'pkg_en-GB', '', 0, 1, 1, 1, '', '', '', '', 0, '1970-01-01 00:00:00', 0, 0);

SELECT setval('#__extensions_extension_id_seq', 10000, false);

--
Expand Down Expand Up @@ -1735,7 +1739,7 @@ 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, 600),
(3, 801),
(4, 28);

--
Expand Down
5 changes: 4 additions & 1 deletion installation/sql/sqlazure/joomla.sql
Original file line number Diff line number Diff line change
Expand Up @@ -1024,6 +1024,9 @@ SELECT 601, 'English (United Kingdom)', 'language', 'en-GB', '', 1, 1, 1, 1, '',
INSERT [#__extensions] ([extension_id], [name], [type], [element], [folder], [client_id], [enabled], [access], [protected], [manifest_cache], [params], [custom_data], [system_data], [checked_out], [checked_out_time], [ordering], [state])
SELECT 700, 'files_joomla', 'file', 'joomla', '', 0, 1, 1, 1, '', '', '', '', 0, '1900-01-01 00:00:00', 0, 0;

INSERT [#__extensions] ([extension_id], [name], [type], [element], [folder], [client_id], [enabled], [access], [protected], [manifest_cache], [params], [custom_data], [system_data], [checked_out], [checked_out_time], [ordering], [state])
SELECT 801, 'English (United Kingdom)', 'package', 'pkg_en-GB', '', 0, 1, 1, 1, '', '', '', '', 0, '1900-01-01 00:00:00', 0, 0;

SET IDENTITY_INSERT [#__extensions] OFF;

/****** Object: Table [#__finder_filters] ******/
Expand Down Expand Up @@ -2743,7 +2746,7 @@ SELECT 1, 700
UNION ALL
SELECT 2, 700
UNION ALL
SELECT 3, 600
SELECT 3, 801
UNION ALL
SELECT 4, 28;

Expand Down

0 comments on commit 4b8f9bb

Please sign in to comment.