Skip to content

Commit ec54dfc

Browse files
committed
Merge pull request #8 from joomla/staging
Update from upstream
2 parents d9b29af + 1af1fe5 commit ec54dfc

File tree

74 files changed

+1830
-396
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+1830
-396
lines changed

.travis.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ matrix:
2222
env: RUN_PHPCS="yes" INSTALL_APCU="yes"
2323
- php: 7.0
2424
env: INSTALL_APCU="yes" INSTALL_APCU_BC_BETA="no" INSTALL_MEMCACHE="no" INSTALL_MEMCACHED="no" INSTALL_REDIS="no" # Disabled apcu_bc install until https://github.com/travis-ci/travis-ci/issues/5207 is resolved
25+
- php: hhvm
26+
env: INSTALL_APCU_BC_BETA="no" INSTALL_MEMCACHE="no" INSTALL_MEMCACHED="no" INSTALL_REDIS="no" # Disabled items that currently do not work in travis-ci hhvm
27+
allow_failures:
28+
- php: hhvm
2529

2630
services:
2731
- memcache

administrator/components/com_admin/script.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ public function update($installer)
3838
$this->updateAssets();
3939
$this->clearStatsCache();
4040
$this->convertTablesToUtf8mb4();
41+
$this->cleanJoomlaCache();
4142

4243
// VERY IMPORTANT! THIS METHOD SHOULD BE CALLED LAST, SINCE IT COULD
4344
// LOGOUT ALL THE USERS
@@ -1853,6 +1854,8 @@ private function serverClaimsUtf8mb4Support($format)
18531854
* @param string $query The query to convert
18541855
*
18551856
* @return string The converted query
1857+
*
1858+
* @since 3.5
18561859
*/
18571860
private function convertUtf8mb4QueryToUtf8($query)
18581861
{
@@ -1868,4 +1871,18 @@ private function convertUtf8mb4QueryToUtf8($query)
18681871
// Replace utf8mb4 with utf8
18691872
return str_replace('utf8mb4', 'utf8', $query);
18701873
}
1874+
1875+
/**
1876+
* This method clean the Joomla Cache using the method `clean` from the com_cache model
1877+
*
1878+
* @return void
1879+
*
1880+
* @since 3.5.1
1881+
*/
1882+
private function cleanJoomlaCache()
1883+
{
1884+
JModelLegacy::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_cache/models');
1885+
$model = JModelLegacy::getInstance('cache', 'CacheModel');
1886+
$model->clean();
1887+
}
18711888
}

administrator/components/com_admin/sql/others/mysql/utf8mb4-conversion-01.sql

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,11 @@ ALTER TABLE `#__content_types` DROP KEY `idx_alias`;
2020
ALTER TABLE `#__finder_links` DROP KEY `idx_title`;
2121
ALTER TABLE `#__menu` DROP KEY `idx_alias`;
2222
ALTER TABLE `#__menu` DROP KEY `idx_client_id_parent_id_alias_language`;
23+
ALTER TABLE `#__menu` DROP KEY `idx_path`;
2324
ALTER TABLE `#__redirect_links` DROP KEY `idx_old_url`;
2425
ALTER TABLE `#__tags` DROP KEY `idx_path`;
2526
ALTER TABLE `#__tags` DROP KEY `idx_alias`;
2627
ALTER TABLE `#__ucm_content` DROP KEY `idx_alias`;
2728
ALTER TABLE `#__ucm_content` DROP KEY `idx_title`;
2829
ALTER TABLE `#__ucm_content` DROP KEY `idx_content_type`;
30+
ALTER TABLE `#__users` DROP KEY `idx_name`;

administrator/components/com_admin/sql/others/mysql/utf8mb4-conversion-02.sql

Lines changed: 41 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,31 @@
11
--
22
-- Step 2 of the UTF-8 Multibyte (utf8mb4) conversion for MySQL
33
--
4-
-- Add back indexes previosly dropped with step 1, utf8mb4-conversion-01.sql,
5-
-- but with limited lenghts of columns, and then perform the conversions
6-
-- for utf8mb4.
4+
-- Enlarge some database columns to avoid data losses, then convert all tables
5+
-- to utf8mb4 or utf8, then set default character sets and collations for all
6+
-- tables, then add back indexes previosly dropped with step 1,
7+
-- utf8mb4-conversion-01.sql, but addd them back with limited lenghts of
8+
-- columns.
79
--
810
-- Do not rename this file or any other of the utf8mb4-conversion-*.sql
911
-- files unless you want to change PHP code, too.
1012
--
11-
-- This file here will the be processed with reporting exceptions.
13+
-- IMPORTANT: When adding an index modification to this file for limiting the
14+
-- length by which one or more columns go into that index,
1215
--
13-
16+
-- 1. remember to add the statement to drop the index to the file for step 1,
17+
-- utf8mb4-conversion-01.sql, and
1418
--
15-
-- Step 2.1: Limit indexes to first 100 so their max allowed lengths would not get exceeded with utf8mb4
19+
-- 2. check if the index is created created or modified in some old schema
20+
-- update sql in an "ALTER TABLE" statement and limit the column length
21+
-- there, too ("CREATE TABLE" is ok, no need to modify those).
22+
--
23+
-- This file here will the be processed with reporting exceptions, in opposite
24+
-- to the file for step 1.
1625
--
17-
18-
ALTER TABLE `#__banners` ADD KEY `idx_metakey_prefix` (`metakey_prefix`(100));
19-
ALTER TABLE `#__banner_clients` ADD KEY `idx_metakey_prefix` (`metakey_prefix`(100));
20-
ALTER TABLE `#__categories` ADD KEY `idx_path` (`path`(100));
21-
ALTER TABLE `#__categories` ADD KEY `idx_alias` (`alias`(100));
22-
ALTER TABLE `#__content_types` ADD KEY `idx_alias` (`type_alias`(100));
23-
ALTER TABLE `#__finder_links` ADD KEY `idx_title` (`title`(100));
24-
ALTER TABLE `#__menu` ADD KEY `idx_alias` (`alias`(100));
25-
ALTER TABLE `#__menu` ADD UNIQUE `idx_client_id_parent_id_alias_language` (`client_id`,`parent_id`,`alias`(100),`language`);
26-
ALTER TABLE `#__redirect_links` ADD KEY `idx_old_url` (`old_url`(100));
27-
ALTER TABLE `#__tags` ADD KEY `idx_path` (`path`(100));
28-
ALTER TABLE `#__tags` ADD KEY `idx_alias` (`alias`(100));
29-
ALTER TABLE `#__ucm_content` ADD KEY `idx_alias` (`core_alias`(100));
30-
ALTER TABLE `#__ucm_content` ADD KEY `idx_title` (`core_title`(100));
31-
ALTER TABLE `#__ucm_content` ADD KEY `idx_content_type` (`core_type_alias`(100));
3226

3327
--
34-
-- Step 2.2: Enlarge columns to avoid data loss on later conversion to utf8mb4
28+
-- Step 2.1: Enlarge columns to avoid data loss on later conversion to utf8mb4
3529
--
3630

3731
ALTER TABLE `#__banners` MODIFY `alias` varchar(400) NOT NULL DEFAULT '';
@@ -49,9 +43,10 @@ ALTER TABLE `#__tags` MODIFY `alias` varchar(400) NOT NULL DEFAULT '';
4943
ALTER TABLE `#__ucm_content` MODIFY `core_type_alias` varchar(400) NOT NULL DEFAULT '' COMMENT 'FK to the content types table';
5044
ALTER TABLE `#__ucm_content` MODIFY `core_title` varchar(400) NOT NULL;
5145
ALTER TABLE `#__ucm_content` MODIFY `core_alias` varchar(400) NOT NULL DEFAULT '';
46+
ALTER TABLE `#__users` MODIFY `name` varchar(400) NOT NULL DEFAULT '';
5247

5348
--
54-
-- Step 2.3: Convert all tables to utf8mb4 chracter set with utf8mb4_unicode_ci collation
49+
-- Step 2.2: Convert all tables to utf8mb4 chracter set with utf8mb4_unicode_ci collation
5550
-- except #__finder_xxx tables, those will have utf8mb4_general_ci collation.
5651
-- Note: The database driver for mysql will change utf8mb4 to utf8 if utf8mb4 is not supported
5752
--
@@ -126,7 +121,7 @@ ALTER TABLE `#__utf8_conversion` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb
126121
ALTER TABLE `#__viewlevels` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
127122

128123
--
129-
-- Step 2.4: Set collation to utf8mb4_bin for formerly utf8_bin collated columns
124+
-- Step 2.3: Set collation to utf8mb4_bin for formerly utf8_bin collated columns
130125
-- and for the lang_code column of the languages table
131126
--
132127

@@ -141,7 +136,7 @@ ALTER TABLE `#__tags` MODIFY `alias` varchar(400) CHARACTER SET utf8mb4 COLLATE
141136
ALTER TABLE `#__ucm_content` MODIFY `core_alias` varchar(400) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT '';
142137

143138
--
144-
-- Step 2.5: Set default character set and collation for all tables
139+
-- Step 2.4: Set default character set and collation for all tables
145140
--
146141

147142
ALTER TABLE `#__assets` DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
@@ -212,3 +207,24 @@ ALTER TABLE `#__user_profiles` DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_uni
212207
ALTER TABLE `#__user_usergroup_map` DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
213208
ALTER TABLE `#__utf8_conversion` DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
214209
ALTER TABLE `#__viewlevels` DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
210+
211+
--
212+
-- Step 2.5: Limit indexes to first 100 so their max allowed lengths would not get exceeded with utf8mb4
213+
--
214+
215+
ALTER TABLE `#__banners` ADD KEY `idx_metakey_prefix` (`metakey_prefix`(100));
216+
ALTER TABLE `#__banner_clients` ADD KEY `idx_metakey_prefix` (`metakey_prefix`(100));
217+
ALTER TABLE `#__categories` ADD KEY `idx_path` (`path`(100));
218+
ALTER TABLE `#__categories` ADD KEY `idx_alias` (`alias`(100));
219+
ALTER TABLE `#__content_types` ADD KEY `idx_alias` (`type_alias`(100));
220+
ALTER TABLE `#__finder_links` ADD KEY `idx_title` (`title`(100));
221+
ALTER TABLE `#__menu` ADD KEY `idx_alias` (`alias`(100));
222+
ALTER TABLE `#__menu` ADD UNIQUE `idx_client_id_parent_id_alias_language` (`client_id`,`parent_id`,`alias`(100),`language`);
223+
ALTER TABLE `#__menu` ADD KEY `idx_path` (`path`(100));
224+
ALTER TABLE `#__redirect_links` ADD KEY `idx_old_url` (`old_url`(100));
225+
ALTER TABLE `#__tags` ADD KEY `idx_path` (`path`(100));
226+
ALTER TABLE `#__tags` ADD KEY `idx_alias` (`alias`(100));
227+
ALTER TABLE `#__ucm_content` ADD KEY `idx_alias` (`core_alias`(100));
228+
ALTER TABLE `#__ucm_content` ADD KEY `idx_title` (`core_title`(100));
229+
ALTER TABLE `#__ucm_content` ADD KEY `idx_content_type` (`core_type_alias`(100));
230+
ALTER TABLE `#__users` ADD KEY `idx_name` (`name`(100));
Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
11
ALTER TABLE `#__menu` DROP INDEX `idx_client_id_parent_id_alias`;
22

3-
ALTER TABLE `#__menu` ADD UNIQUE `idx_client_id_parent_id_alias_language` ( `client_id` , `parent_id` , `alias` , `language` );
3+
--
4+
-- The following statment had to be modified for utf8mb4 in Joomla! 3.5.1, changing
5+
-- `alias` to `alias`(100)
6+
--
7+
8+
ALTER TABLE `#__menu` ADD UNIQUE `idx_client_id_parent_id_alias_language` ( `client_id` , `parent_id` , `alias`(100) , `language` );
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
--
2+
-- Make #__user_keys.user_id fit to #__users.username
3+
--
4+
5+
ALTER TABLE `#__user_keys` MODIFY `user_id` varchar(150) NOT NULL;
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
--
2+
-- Reset UTF-8 Multibyte (utf8mb4) or UTF-8 conversion status
3+
-- to force a new conversion when updating from version 3.5.0
4+
--
5+
6+
UPDATE `#__utf8_conversion` SET `converted` = 0
7+
WHERE (SELECT COUNT(*) FROM `#__schemas` WHERE `extension_id`=700 AND `version_id` LIKE '3.5.0%') = 1;

administrator/components/com_admin/sql/updates/postgresql/3.1.0.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ CREATE TABLE "#__contentitem_tag_map" (
4747
CONSTRAINT "uc_ItemnameTagid" UNIQUE ("type_alias", "content_item_id", "tag_id")
4848
);
4949

50-
CREATE INDEX "#__contentitem_tag_map_idx_tag_name" ON "#__contentitem_tag_map" ("tag_id", "type_alias");
50+
CREATE INDEX "#__contentitem_tag_map_idx_tag_type" ON "#__contentitem_tag_map" ("tag_id", "type_alias");
5151
CREATE INDEX "#__contentitem_tag_map_idx_date_id" ON "#__contentitem_tag_map" ("tag_date", "tag_id");
5252
CREATE INDEX "#__contentitem_tag_map_idx_tag" ON "#__contentitem_tag_map" ("tag_id");
5353
CREATE INDEX "#__contentitem_tag_map_idx_core_content_id" ON "#__contentitem_tag_map" ("core_content_id");
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
ALTER TABLE "#__contentitem_tag_map" DROP INDEX "#__contentitem_tag_map_idx_tag";
2-
ALTER TABLE "#__contentitem_tag_map" DROP INDEX "#__contentitem_tag_map_idx_type";
1+
DROP INDEX "#__contentitem_tag_map_idx_tag";
2+
DROP INDEX "#__contentitem_tag_map_idx_type";
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
ALTER TABLE "#__redirect_links" DROP CONSTRAINT "#__redirect_links_idx_link_old";
2-
ALTER TABLE "#__redirect_links" ALTER COLUMN "old_url" TYPE varchar(2048);
3-
ALTER TABLE "#__redirect_links" ALTER COLUMN "new_url" TYPE varchar(2048);
4-
ALTER TABLE "#__redirect_links" ALTER COLUMN "referer" TYPE varchar(2048);
2+
ALTER TABLE "#__redirect_links" ALTER COLUMN "old_url" TYPE character varying(2048);
3+
ALTER TABLE "#__redirect_links" ALTER COLUMN "new_url" TYPE character varying(2048);
4+
ALTER TABLE "#__redirect_links" ALTER COLUMN "referer" TYPE character varying(2048);
55
CREATE INDEX "#__idx_link_old" ON "#__redirect_links" ("old_url");

0 commit comments

Comments
 (0)