Skip to content

Commit

Permalink
fix merge conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
zero-24 committed Apr 12, 2016
2 parents ea5f249 + c8c2d20 commit 1718d29
Show file tree
Hide file tree
Showing 313 changed files with 5,325 additions and 4,714 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ Desktop.ini
/libraries/vendor/ircmaxell/password-compat/phpunit.xml.dist
/libraries/vendor/ircmaxell/password-compat/README.md
/libraries/vendor/ircmaxell/password-compat/version-test.php
/libraries/vendor/joomla/*/.gitignore
/libraries/vendor/joomla/*/.gitmodules
/libraries/vendor/joomla/*/docs
/libraries/vendor/joomla/*/Tests
/libraries/vendor/joomla/*/vendor
Expand Down
4 changes: 4 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ matrix:
env: RUN_PHPCS="yes" INSTALL_APCU="yes"
- php: 7.0
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
- php: hhvm
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
allow_failures:
- php: hhvm

services:
- memcache
Expand Down
1 change: 1 addition & 0 deletions administrator/components/com_admin/models/sysinfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,7 @@ public function &getPhpSettings()
'zip' => function_exists('zip_open') && function_exists('zip_read'),
'mbstring' => extension_loaded('mbstring'),
'iconv' => function_exists('iconv'),
'mcrypt' => extension_loaded('mcrypt'),
'max_input_vars' => ini_get('max_input_vars'),
);

Expand Down
20 changes: 18 additions & 2 deletions administrator/components/com_admin/script.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class JoomlaInstallerScript
/**
* Method to update Joomla!
*
* @param JInstallerFile $installer The class calling this method
* @param JInstallerAdapterFile $installer The class calling this method
*
* @return void
*/
Expand All @@ -31,13 +31,13 @@ public function update($installer)
JLog::addLogger($options, JLog::INFO, array('Update', 'databasequery', 'jerror'));
JLog::add(JText::_('COM_JOOMLAUPDATE_UPDATE_LOG_DELETE_FILES'), JLog::INFO, 'Update');

$this->deleteUnexistingFiles();
$this->updateManifestCaches();
$this->updateDatabase();
$this->clearRadCache();
$this->updateAssets();
$this->clearStatsCache();
$this->convertTablesToUtf8mb4();
$this->cleanJoomlaCache();

// VERY IMPORTANT! THIS METHOD SHOULD BE CALLED LAST, SINCE IT COULD
// LOGOUT ALL THE USERS
Expand Down Expand Up @@ -1853,6 +1853,8 @@ private function serverClaimsUtf8mb4Support($format)
* @param string $query The query to convert
*
* @return string The converted query
*
* @since 3.5
*/
private function convertUtf8mb4QueryToUtf8($query)
{
Expand All @@ -1868,4 +1870,18 @@ private function convertUtf8mb4QueryToUtf8($query)
// Replace utf8mb4 with utf8
return str_replace('utf8mb4', 'utf8', $query);
}

/**
* This method clean the Joomla Cache using the method `clean` from the com_cache model
*
* @return void
*
* @since 3.5.1
*/
private function cleanJoomlaCache()
{
JModelLegacy::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_cache/models');
$model = JModelLegacy::getInstance('cache', 'CacheModel');
$model->clean();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,19 @@
-- The file for step 2 will the be processed with reporting exceptions.
--

ALTER TABLE `#__banners` DROP KEY `idx_metakey_prefix`;
ALTER TABLE `#__banner_clients` DROP KEY `idx_metakey_prefix`;
ALTER TABLE `#__categories` DROP KEY `idx_path`;
ALTER TABLE `#__categories` DROP KEY `idx_alias`;
ALTER TABLE `#__content_types` DROP KEY `idx_alias`;
ALTER TABLE `#__finder_links` DROP KEY `idx_title`;
ALTER TABLE `#__menu` DROP KEY `idx_alias`;
ALTER TABLE `#__menu` DROP KEY `idx_client_id_parent_id_alias_language`;
ALTER TABLE `#__menu` DROP KEY `idx_path`;
ALTER TABLE `#__redirect_links` DROP KEY `idx_old_url`;
ALTER TABLE `#__tags` DROP KEY `idx_path`;
ALTER TABLE `#__tags` DROP KEY `idx_alias`;
ALTER TABLE `#__ucm_content` DROP KEY `idx_alias`;
ALTER TABLE `#__ucm_content` DROP KEY `idx_title`;
ALTER TABLE `#__ucm_content` DROP KEY `idx_content_type`;
ALTER TABLE `#__users` DROP KEY `idx_name`;
Original file line number Diff line number Diff line change
@@ -1,42 +1,52 @@
--
-- Step 2 of the UTF-8 Multibyte (utf8mb4) conversion for MySQL
--
-- Add back indexes previosly dropped with step 1, utf8mb4-conversion-01.sql,
-- but with limited lenghts of columns, and then perform the conversions
-- for utf8mb4.
-- Enlarge some database columns to avoid data losses, then convert all tables
-- to utf8mb4 or utf8, then set default character sets and collations for all
-- tables, then add back indexes previosly dropped with step 1,
-- utf8mb4-conversion-01.sql, but addd them back with limited lenghts of
-- columns.
--
-- Do not rename this file or any other of the utf8mb4-conversion-*.sql
-- files unless you want to change PHP code, too.
--
-- This file here will the be processed with reporting exceptions.
-- IMPORTANT: When adding an index modification to this file for limiting the
-- length by which one or more columns go into that index,
--

-- 1. remember to add the statement to drop the index to the file for step 1,
-- utf8mb4-conversion-01.sql, and
--
-- Step 2.1: Limit indexes to first 100 so their max allowed lengths would not get exceeded with utf8mb4
-- 2. check if the index is created created or modified in some old schema
-- update sql in an "ALTER TABLE" statement and limit the column length
-- there, too ("CREATE TABLE" is ok, no need to modify those).
--
-- This file here will the be processed with reporting exceptions, in opposite
-- to the file for step 1.
--

ALTER TABLE `#__categories` ADD KEY `idx_alias` (`alias`(100));
ALTER TABLE `#__menu` ADD KEY `idx_alias` (`alias`(100));
ALTER TABLE `#__menu` ADD UNIQUE `idx_client_id_parent_id_alias_language` (`client_id`,`parent_id`,`alias`(100),`language`);
ALTER TABLE `#__redirect_links` ADD KEY `idx_old_url` (`old_url`(100));
ALTER TABLE `#__tags` ADD KEY `idx_alias` (`alias`(100));
ALTER TABLE `#__ucm_content` ADD KEY `idx_alias` (`core_alias`(100));

--
-- Step 2.2: Enlarge columns to avoid data loss on later conversion to utf8mb4
-- Step 2.1: Enlarge columns to avoid data loss on later conversion to utf8mb4
--

ALTER TABLE `#__banners` MODIFY `alias` varchar(400) NOT NULL DEFAULT '';
ALTER TABLE `#__banners` MODIFY `metakey_prefix` varchar(400) NOT NULL DEFAULT '';
ALTER TABLE `#__categories` MODIFY `path` varchar(400) NOT NULL DEFAULT '';
ALTER TABLE `#__categories` MODIFY `alias` varchar(400) NOT NULL DEFAULT '';
ALTER TABLE `#__content_types` MODIFY `type_alias` varchar(400) NOT NULL DEFAULT '';
ALTER TABLE `#__finder_links` MODIFY `title` varchar(400) DEFAULT NULL;
ALTER TABLE `#__contact_details` MODIFY `alias` varchar(400) NOT NULL DEFAULT '';
ALTER TABLE `#__content` MODIFY `alias` varchar(400) NOT NULL DEFAULT '';
ALTER TABLE `#__menu` MODIFY `alias` varchar(400) NOT NULL COMMENT 'The SEF alias of the menu item.';
ALTER TABLE `#__newsfeeds` MODIFY `alias` varchar(400) NOT NULL DEFAULT '';
ALTER TABLE `#__tags` MODIFY `path` varchar(400) NOT NULL DEFAULT '';
ALTER TABLE `#__tags` MODIFY `alias` varchar(400) NOT NULL DEFAULT '';
ALTER TABLE `#__ucm_content` MODIFY `core_type_alias` varchar(400) NOT NULL DEFAULT '' COMMENT 'FK to the content types table';
ALTER TABLE `#__ucm_content` MODIFY `core_title` varchar(400) NOT NULL;
ALTER TABLE `#__ucm_content` MODIFY `core_alias` varchar(400) NOT NULL DEFAULT '';
ALTER TABLE `#__users` MODIFY `name` varchar(400) NOT NULL DEFAULT '';

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

--
-- Step 2.4: Set collation to utf8mb4_bin for formerly utf8_bin collated columns
-- Step 2.3: Set collation to utf8mb4_bin for formerly utf8_bin collated columns
-- and for the lang_code column of the languages table
--

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

--
-- Step 2.5: Set default character set and collation for all tables
-- Step 2.4: Set default character set and collation for all tables
--

ALTER TABLE `#__assets` DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
Expand Down Expand Up @@ -197,3 +207,24 @@ ALTER TABLE `#__user_profiles` DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_uni
ALTER TABLE `#__user_usergroup_map` DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `#__utf8_conversion` DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `#__viewlevels` DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

--
-- Step 2.5: Limit indexes to first 100 so their max allowed lengths would not get exceeded with utf8mb4
--

ALTER TABLE `#__banners` ADD KEY `idx_metakey_prefix` (`metakey_prefix`(100));
ALTER TABLE `#__banner_clients` ADD KEY `idx_metakey_prefix` (`metakey_prefix`(100));
ALTER TABLE `#__categories` ADD KEY `idx_path` (`path`(100));
ALTER TABLE `#__categories` ADD KEY `idx_alias` (`alias`(100));
ALTER TABLE `#__content_types` ADD KEY `idx_alias` (`type_alias`(100));
ALTER TABLE `#__finder_links` ADD KEY `idx_title` (`title`(100));
ALTER TABLE `#__menu` ADD KEY `idx_alias` (`alias`(100));
ALTER TABLE `#__menu` ADD UNIQUE `idx_client_id_parent_id_alias_language` (`client_id`,`parent_id`,`alias`(100),`language`);
ALTER TABLE `#__menu` ADD KEY `idx_path` (`path`(100));
ALTER TABLE `#__redirect_links` ADD KEY `idx_old_url` (`old_url`(100));
ALTER TABLE `#__tags` ADD KEY `idx_path` (`path`(100));
ALTER TABLE `#__tags` ADD KEY `idx_alias` (`alias`(100));
ALTER TABLE `#__ucm_content` ADD KEY `idx_alias` (`core_alias`(100));
ALTER TABLE `#__ucm_content` ADD KEY `idx_title` (`core_title`(100));
ALTER TABLE `#__ucm_content` ADD KEY `idx_content_type` (`core_type_alias`(100));
ALTER TABLE `#__users` ADD KEY `idx_name` (`name`(100));
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
ALTER TABLE `#__menu` DROP INDEX `idx_client_id_parent_id_alias`;

ALTER TABLE `#__menu` ADD UNIQUE `idx_client_id_parent_id_alias_language` ( `client_id` , `parent_id` , `alias` , `language` );
--
-- The following statment had to be modified for utf8mb4 in Joomla! 3.5.1, changing
-- `alias` to `alias`(100)
--

ALTER TABLE `#__menu` ADD UNIQUE `idx_client_id_parent_id_alias_language` ( `client_id` , `parent_id` , `alias`(100) , `language` );
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
--
-- Make #__user_keys.user_id fit to #__users.username
--

ALTER TABLE `#__user_keys` MODIFY `user_id` varchar(150) NOT NULL;
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
--
-- Reset UTF-8 Multibyte (utf8mb4) or UTF-8 conversion status
-- to force a new conversion when updating from version 3.5.0
--

UPDATE `#__utf8_conversion` SET `converted` = 0
WHERE (SELECT COUNT(*) FROM `#__schemas` WHERE `extension_id`=700 AND `version_id` LIKE '3.5.0%') = 1;
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ CREATE TABLE "#__contentitem_tag_map" (
CONSTRAINT "uc_ItemnameTagid" UNIQUE ("type_alias", "content_item_id", "tag_id")
);

CREATE INDEX "#__contentitem_tag_map_idx_tag_name" ON "#__contentitem_tag_map" ("tag_id", "type_alias");
CREATE INDEX "#__contentitem_tag_map_idx_tag_type" ON "#__contentitem_tag_map" ("tag_id", "type_alias");
CREATE INDEX "#__contentitem_tag_map_idx_date_id" ON "#__contentitem_tag_map" ("tag_date", "tag_id");
CREATE INDEX "#__contentitem_tag_map_idx_tag" ON "#__contentitem_tag_map" ("tag_id");
CREATE INDEX "#__contentitem_tag_map_idx_core_content_id" ON "#__contentitem_tag_map" ("core_content_id");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
ALTER TABLE "#__contentitem_tag_map" DROP INDEX "#__contentitem_tag_map_idx_tag";
ALTER TABLE "#__contentitem_tag_map" DROP INDEX "#__contentitem_tag_map_idx_type";
DROP INDEX "#__contentitem_tag_map_idx_tag";
DROP INDEX "#__contentitem_tag_map_idx_type";
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ALTER TABLE "#__redirect_links" DROP CONSTRAINT "#__redirect_links_idx_link_old"
ALTER TABLE "#__redirect_links" ALTER COLUMN "old_url" TYPE varchar(2048);
ALTER TABLE "#__redirect_links" ALTER COLUMN "new_url" TYPE varchar(2048);
ALTER TABLE "#__redirect_links" ALTER COLUMN "referer" TYPE varchar(2048);
ALTER TABLE "#__redirect_links" DROP CONSTRAINT "#__redirect_links_idx_link_old";
ALTER TABLE "#__redirect_links" ALTER COLUMN "old_url" TYPE character varying(2048);
ALTER TABLE "#__redirect_links" ALTER COLUMN "new_url" TYPE character varying(2048);
ALTER TABLE "#__redirect_links" ALTER COLUMN "referer" TYPE character varying(2048);
CREATE INDEX "#__idx_link_old" ON "#__redirect_links" ("old_url");
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,14 @@
<?php echo JHtml::_('phpsetting.set', $this->php_settings['iconv']); ?>
</td>
</tr>
<tr>
<td>
<?php echo JText::_('COM_ADMIN_MCRYPT_ENABLED'); ?>
</td>
<td>
<?php echo JHtml::_('phpsetting.set', $this->php_settings['mcrypt']); ?>
</td>
</tr>
<tr>
<td>
<?php echo JText::_('COM_ADMIN_MAX_INPUT_VARS'); ?>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ public function display($tpl = null)
return JError::raiseWarning(404, JText::_('JERROR_ALERTNOAUTHOR'));
}

header('Content-Type: text/plain; charset=utf-8');
header('Content-Description: File Transfer');
header('Content-Disposition: attachment; filename="systeminfo-' . date("c") . '.txt"');
header('Cache-Control: must-revalidate');
Expand Down
23 changes: 19 additions & 4 deletions administrator/components/com_banners/tables/banner.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,21 @@ public function check()
$this->ordering = self::getNextOrder($this->_db->quoteName('catid') . '=' . $this->_db->quote($this->catid) . ' AND state>=0');
}

if (empty($this->publish_up))
{
$this->publish_up = $this->getDbo()->getNullDate();
}

if (empty($this->publish_down))
{
$this->publish_down = $this->getDbo()->getNullDate();
}

if (empty($this->modified))
{
$this->modified = $this->getDbo()->getNullDate();
}

return true;
}

Expand Down Expand Up @@ -178,19 +193,19 @@ public function store($updateNulls = false)
break;
case 2:
$date = JFactory::getDate('+1 year ' . date('Y-m-d', strtotime('now')));
$this->reset = $this->_db->quote($date->toSql());
$this->reset = $date->toSql();
break;
case 3:
$date = JFactory::getDate('+1 month ' . date('Y-m-d', strtotime('now')));
$this->reset = $this->_db->quote($date->toSql());
$this->reset = $date->toSql();
break;
case 4:
$date = JFactory::getDate('+7 day ' . date('Y-m-d', strtotime('now')));
$this->reset = $this->_db->quote($date->toSql());
$this->reset = $date->toSql();
break;
case 5:
$date = JFactory::getDate('+1 day ' . date('Y-m-d', strtotime('now')));
$this->reset = $this->_db->quote($date->toSql());
$this->reset = $date->toSql();
break;
}

Expand Down
10 changes: 5 additions & 5 deletions administrator/components/com_banners/views/banners/view.html.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,19 +111,19 @@ protected function addToolbar()

if ($canDo->get('core.edit.state'))
{
if ($this->state->get('filter.state') != 2)
if ($this->state->get('filter.published') != 2)
{
JToolbarHelper::publish('banners.publish', 'JTOOLBAR_PUBLISH', true);
JToolbarHelper::unpublish('banners.unpublish', 'JTOOLBAR_UNPUBLISH', true);
}

if ($this->state->get('filter.state') != -1)
if ($this->state->get('filter.published') != -1)
{
if ($this->state->get('filter.state') != 2)
if ($this->state->get('filter.published') != 2)
{
JToolbarHelper::archiveList('banners.archive');
}
elseif ($this->state->get('filter.state') == 2)
elseif ($this->state->get('filter.published') == 2)
{
JToolbarHelper::unarchiveList('banners.publish');
}
Expand All @@ -149,7 +149,7 @@ protected function addToolbar()
JToolbar::getInstance('toolbar')->appendButton('Custom', $dhtml, 'batch');
}

if ($this->state->get('filter.state') == -2 && $canDo->get('core.delete'))
if ($this->state->get('filter.published') == -2 && $canDo->get('core.delete'))
{
JToolbarHelper::deleteList('JGLOBAL_CONFIRM_DELETE', 'banners.delete', 'JTOOLBAR_EMPTY_TRASH');
}
Expand Down
Loading

0 comments on commit 1718d29

Please sign in to comment.