Skip to content

Commit

Permalink
Merge branch 'staging' into fix-17198
Browse files Browse the repository at this point in the history
  • Loading branch information
wilsonge committed Aug 17, 2017
2 parents 58b20cf + 0157a7f commit 6fe4a6e
Show file tree
Hide file tree
Showing 751 changed files with 11,259 additions and 5,105 deletions.
1 change: 1 addition & 0 deletions .appveyor.yml
Expand Up @@ -91,6 +91,7 @@ install:
- IF %PHP%==1 echo wincache.enablecli = 1 >> php.ini
- IF %PHP%==1 echo zend_extension=php_opcache.dll >> php.ini
- IF %PHP%==1 echo opcache.enable_cli=1 >> php.ini
- IF %PHP%==1 echo extension=php_ldap.dll >> php.ini
- IF %PHP%==1 echo @php %%~dp0composer.phar %%* > composer.bat
- appveyor-retry appveyor DownloadFile https://getcomposer.org/composer.phar
- cd C:\projects\joomla-cms
Expand Down
3 changes: 1 addition & 2 deletions .github/CONTRIBUTING.md
Expand Up @@ -20,6 +20,5 @@ There are other branches available which serve specific purposes.
| Branch | Purpose |
| ------ | ------- |
| staging | Current codebase. Branch for the next minor Joomla version. New backward compatible features go into this branch. |
| master | Each commit made to staging gets tested if it passes unit tests and codestyle rules. It is then merged into master. This is done automatically. |
| 3.8-dev | Branch for the next minor Joomla version. The 3.8.0 release will only include compatibility features for 4.0. Commits to staging will be applied to this branch as well. |
| 3.9-dev | Branch for the next minor Joomla version. The 3.9.0 release will only include compatibility features for 4.0. Commits to staging will be applied to this branch as well. |
| 4.0-dev | Branch for the next major Joomla version. New features go into this branch. Commits to staging will be applied to this branch as well. |
8 changes: 8 additions & 0 deletions .github/SUPPORT.md
@@ -0,0 +1,8 @@
Where can you get support and help?
====================
* [The Joomla! Documentation](https://docs.joomla.org/Special:MyLanguage/Main_Page);
* [Frequently Asked Questions](https://docs.joomla.org/Special:MyLanguage/Category:FAQ) (FAQ);
* Find the [information you need](https://docs.joomla.org/Special:MyLanguage/Start_here);
* Find [help and other users](https://www.joomla.org/about-joomla/create-and-share.html);
* Post questions at [our forums](https://forum.joomla.org);
* [Joomla Resources Directory](https://resources.joomla.org) (JRD).
6 changes: 6 additions & 0 deletions .gitignore
Expand Up @@ -12,6 +12,7 @@
/administrator/logs
/cache
/installation/cache
/installation/sessions
/libraries/autoload_psr4.php
/tmp
/configuration.php
Expand Down Expand Up @@ -75,12 +76,14 @@ 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/*/.gitattributes
/libraries/vendor/joomla/*/.github
/libraries/vendor/joomla/*/.gitignore
/libraries/vendor/joomla/*/.gitmodules
/libraries/vendor/joomla/*/docs
/libraries/vendor/joomla/*/Tests
/libraries/vendor/joomla/*/vendor
/libraries/vendor/joomla/*/.scrutinizer.yml
/libraries/vendor/joomla/*/.travis.yml
/libraries/vendor/joomla/*/CONTRIBUTING.md
/libraries/vendor/joomla/*/composer.json
Expand Down Expand Up @@ -132,8 +135,11 @@ Desktop.ini
/libraries/vendor/phpmailer/phpmailer/.travis.yml
/libraries/vendor/phpmailer/phpmailer/changelog.md
/libraries/vendor/phpmailer/phpmailer/composer.json
/libraries/vendor/phpmailer/phpmailer/ISSUE_TEMPLATE.md
/libraries/vendor/phpmailer/phpmailer/phpdoc.dist.xml
/libraries/vendor/phpmailer/phpmailer/README.md
/libraries/vendor/phpmailer/phpmailer/travis.phpunit.xml.dist
/libraries/vendor/phpmailer/phpmailer/UPGRADING.md
/libraries/vendor/phpmailer/phpmailer/extras/README.md
/libraries/vendor/phpmailer/phpmailer/get_oauth_token.php
/libraries/vendor/psr/log/Psr/Log/Test
Expand Down
3 changes: 3 additions & 0 deletions .travis.yml
Expand Up @@ -29,9 +29,12 @@ matrix:
env: INSTALL_APCU="yes"
- php: 5.6
env: INSTALL_APCU="yes"
- php: 7.2
env: INSTALL_APCU="yes" INSTALL_MEMCACHE="no"
- php: nightly
env: INSTALL_APCU="yes" INSTALL_MEMCACHE="no"
allow_failures:
- php: 7.2
- php: nightly

services:
Expand Down
8 changes: 4 additions & 4 deletions README.md
Expand Up @@ -71,7 +71,7 @@ Where can you get support and help?
* Find the [information you need](https://docs.joomla.org/Special:MyLanguage/Start_here);
* Find [help and other users](https://www.joomla.org/about-joomla/create-and-share.html);
* Post questions at [our forums](https://forum.joomla.org);
* [Joomla Resources Directory](https://resources.joomla.org/) (JRD).
* [Joomla Resources Directory](https://resources.joomla.org) (JRD).

Do you already have a Joomla! site that isn't built with Joomla! 3.x?
---------------------
Expand All @@ -82,9 +82,9 @@ Do you already have a Joomla! site that isn't built with Joomla! 3.x?

Do you want to improve Joomla?
--------------------
* Where to [request a feature](https://issues.joomla.org/)?
* How do you [report a bug](https://docs.joomla.org/Special:MyLanguage/Filing_bugs_and_issues) on the [Issue Tracker](https://issues.joomla.org/)?
* Get Involved: Joomla! is community developed software. [Join the community](https://volunteers.joomla.org/).
* Where to [request a feature](https://issues.joomla.org)?
* How do you [report a bug](https://docs.joomla.org/Special:MyLanguage/Filing_bugs_and_issues) on the [Issue Tracker](https://issues.joomla.org)?
* Get Involved: Joomla! is community developed software. [Join the community](https://volunteers.joomla.org).
* Documentation for [Developers](https://docs.joomla.org/Special:MyLanguage/Portal:Developers).
* Documentation for [Web designers](https://docs.joomla.org/Special:MyLanguage/Web_designers).

Expand Down
6 changes: 3 additions & 3 deletions README.txt
Expand Up @@ -13,7 +13,7 @@
3- Is Joomla! for you?
* Joomla! is the right solution for most content web projects: https://docs.joomla.org/Special:MyLanguage/Portal:Learn_More
* See Joomla's core features - https://www.joomla.org/core-features.html
* Try out our online demo: https://demo.joomla.org/
* Try out our online demo: https://demo.joomla.org

4- How to find a Joomla! translation?
* Repository of accredited language packs: https://community.joomla.org/translations.html
Expand Down Expand Up @@ -59,9 +59,9 @@
* How to migrate from 1.5.x to 3.x? Tutorial: https://docs.joomla.org/Special:MyLanguage/Joomla_1.5_to_3.x_Step_by_Step_Migration

12- Do you want to improve Joomla?
* Where to request a feature? https://issues.joomla.org/
* Where to request a feature? https://issues.joomla.org
* How do you report a bug? https://docs.joomla.org/Special:MyLanguage/Filing_bugs_and_issues
* Get Involved: Joomla! is a community developed software. Join the community at https://volunteers.joomla.org/
* Get Involved: Joomla! is a community developed software. Join the community at https://volunteers.joomla.org
* Documentation for Developers: https://docs.joomla.org/Special:MyLanguage/Portal:Developers
* Documentation for Web designers: https://docs.joomla.org/Special:MyLanguage/Web_designers

Expand Down
6 changes: 5 additions & 1 deletion administrator/components/com_admin/models/sysinfo.php
Expand Up @@ -118,11 +118,15 @@ class AdminModelSysInfo extends JModelLegacy
'proxy_host',
'proxy_user',
'proxy_pass',
'redis_server_host',
'redis_server_auth',
'secret',
'sendmail',
'session.save_path',
'session_memcache_server_host',
'session_memcached_server_host',
'session_redis_server_host',
'session_redis_server_auth',
'sitename',
'smtphost',
'tmp_path',
Expand Down Expand Up @@ -159,7 +163,7 @@ class AdminModelSysInfo extends JModelLegacy
* Remove sections of data marked as private in the privateSettings
*
* @param array $dataArray Array with data tha may contain private informati
* @param string $dataType Type of data to search for an specific section in the privateSettings array
* @param string $dataType Type of data to search for a specific section in the privateSettings array
*
* @return array
*
Expand Down
16 changes: 16 additions & 0 deletions administrator/components/com_admin/script.php
Expand Up @@ -1825,6 +1825,17 @@ public function deleteUnexistingFiles()
'/libraries/joomla/form/rule/url.php',
'/libraries/joomla/form/rule/username.php',
'/libraries/joomla/form/wrapper/helper.php',
'/libraries/joomla/image/filter/backgroundfill.php',
'/libraries/joomla/image/filter/brightness.php',
'/libraries/joomla/image/filter/contrast.php',
'/libraries/joomla/image/filter/edgedetect.php',
'/libraries/joomla/image/filter/emboss.php',
'/libraries/joomla/image/filter/grayscale.php',
'/libraries/joomla/image/filter/negate.php',
'/libraries/joomla/image/filter/sketchy.php',
'/libraries/joomla/image/filter/smooth.php',
'/libraries/joomla/image/filter.php',
'/libraries/joomla/image/image.php',
'/libraries/joomla/input/cli.php',
'/libraries/joomla/input/cookie.php',
'/libraries/joomla/input/files.php',
Expand Down Expand Up @@ -1907,6 +1918,8 @@ public function deleteUnexistingFiles()
'/libraries/legacy/view/legacy.php',
'/libraries/legacy/web/client.php',
'/libraries/legacy/web/web.php',
'/administrator/modules/mod_menu/preset/enabled.php',
'/administrator/modules/mod_menu/preset/disabled.php',
);

// TODO There is an issue while deleting folders using the ftp mode
Expand Down Expand Up @@ -2106,6 +2119,8 @@ public function deleteUnexistingFiles()
'/libraries/joomla/filter',
'/libraries/joomla/form/rule',
'/libraries/joomla/form/wrapper',
'/libraries/joomla/image/filter',
'/libraries/joomla/image',
'/libraries/joomla/input',
'/libraries/joomla/language/stemmer',
'/libraries/joomla/language/wrapper',
Expand All @@ -2129,6 +2144,7 @@ public function deleteUnexistingFiles()
'/libraries/legacy/model',
'/libraries/legacy/view',
'/libraries/legacy/web',
'/administrator/modules/mod_menu/preset',
);

jimport('joomla.filesystem.file');
Expand Down
@@ -0,0 +1,5 @@
INSERT INTO `#__extensions`
(`extension_id`, `package_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
(318, 0, 'mod_sampledata', 'module', 'mod_sampledata', '', 1, 0, 1, 0, '', '{}', '', '', 0, '0000-00-00 00:00:00', 0, 0),
(479, 0, 'plg_sampledata_blog', 'plugin', 'blog', 'sampledata', 0, 0, 1, 0, '', '', '', '', 0, '0000-00-00 00:00:00', 0, 0);
@@ -1,3 +1,3 @@
ALTER TABLE "#__menu_types" ADD "client_id" int DEFAULT 0 NOT NULL;
ALTER TABLE "#__menu_types" ADD COLUMN "client_id" int DEFAULT 0 NOT NULL;

UPDATE "#__menu" SET "published" = 1 WHERE "menutype" = 'main' OR "menutype" = 'menu';
@@ -1,2 +1,2 @@
-- Replace language image UNIQUE index for a normal INDEX.
ALTER TABLE "#__languages" DROP CONSTRAINT "#__idx_image";
ALTER TABLE "#__languages" DROP CONSTRAINT "#__languages_idx_image";
@@ -1,2 +1,2 @@
-- Set integer field default values.
UPDATE `#__extensions` SET `params` = '{"multiple":"0","first":"1","last":"100","step":"1"}' WHERE `name` = 'plg_fields_integer';
UPDATE "#__extensions" SET "params" = '{"multiple":"0","first":"1","last":"100","step":"1"}' WHERE "name" = 'plg_fields_integer';
@@ -0,0 +1,5 @@
INSERT INTO "#__extensions"
("extension_id", "package_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
(318, 0, 'mod_sampledata', 'module', 'mod_sampledata', '', 1, 0, 1, 0, '', '{}', '', '', 0, '1970-01-01 00:00:00', 0, 0),
(479, 0, 'plg_sampledata_blog', 'plugin', 'blog', 'sampledata', 0, 0, 1, 0, '', '', '', '', 0, '1970-01-01 00:00:00', 0, 0);
@@ -0,0 +1,4 @@
INSERT INTO "#__extensions" ("extension_id", "package_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
(318, 0, 'mod_sampledata', 'module', 'mod_sampledata', '', 1, 0, 1, 0, '', '{}', '', '', 0, '1900-01-01 00:00:00', 0, 0),
(479, 0, 'plg_sampledata_blog', 'plugin', 'blog', 'sampledata', 0, 0, 1, 0, '', '', '', '', 0, '1900-01-01 00:00:00', 0, 0);
15 changes: 15 additions & 0 deletions administrator/components/com_admin/views/help/tmpl/langforum.php
@@ -0,0 +1,15 @@
<?php
/**
* @package Joomla.Administrator
* @subpackage com_admin
*
* @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/

defined('_JEXEC') or die;

$forumId = (int) JText::_('COM_ADMIN_HELP_SUPPORT_OFFICIAL_LANGUAGE_FORUM_VALUE');
$forum_url = 'https://forum.joomla.org/viewforum.php?f=' . $forumId;

JFactory::getApplication()->redirect($forum_url);
Expand Up @@ -154,7 +154,7 @@ public function display($tpl = null)
// We also need to change the category filter to show show categories with All or the forced language.
if ($forcedLanguage = JFactory::getApplication()->input->get('forcedLanguage', '', 'CMD'))
{
// If the language is forced we can't allow to select the language, so transform the language selector filter into an hidden field.
// If the language is forced we can't allow to select the language, so transform the language selector filter into a hidden field.
$languageXml = new SimpleXMLElement('<field name="language" type="hidden" default="' . $forcedLanguage . '" />');
$this->filterForm->setField($languageXml, 'filter', true);

Expand Down
Expand Up @@ -49,6 +49,7 @@ public static function association($catid, $extension = 'com_content')
->select('l.lang_code')
->from('#__categories as c')
->where('c.id IN (' . implode(',', array_values($associations)) . ')')
->where('c.id != ' . $catid)
->join('LEFT', '#__languages as l ON c.language=l.lang_code')
->select('l.image')
->select('l.title as language_title');
Expand Down
53 changes: 53 additions & 0 deletions administrator/components/com_categories/models/category.php
Expand Up @@ -57,6 +57,9 @@ public function __construct($config = array())
parent::__construct($config);
$extension = JFactory::getApplication()->input->get('extension', 'com_content');
$this->typeAlias = $extension . '.category';

// Add a new batch command
$this->batch_commands['flip_ordering'] = 'batchFlipordering';
}

/**
Expand Down Expand Up @@ -819,6 +822,56 @@ protected function batchTag($value, $pks, $contexts)
return true;
}

/**
* Batch flip category ordering.
*
* @param integer $value The new category.
* @param array $pks An array of row IDs.
* @param array $contexts An array of item contexts.
*
* @return mixed An array of new IDs on success, boolean false on failure.
*
* @since 3.6.3
*/
protected function batchFlipordering($value, $pks, $contexts)
{
$successful = array();

$db = $this->getDbo();
$query = $db->getQuery(true);

/**
* For each category get the max ordering value
* Re-order with max - ordering
*/
foreach ($pks as $id)
{
$query->select('MAX(ordering)')
->from('#__content')
->where($db->qn('catid') . ' = ' . $db->q($id));

$db->setQuery($query);

$max = (int) $db->loadresult();
$max++;

$query->clear();

$query->update('#__content')
->set($db->qn('ordering') . ' = ' . $max . ' - ' . $db->qn('ordering'))
->where($db->qn('catid') . ' = ' . $db->q($id));

$db->setQuery($query);

if ($db->execute())
{
$successful[] = $id;
}
}

return empty($successful) ? false : $successful;
}

/**
* Batch copy categories to a new category.
*
Expand Down
Expand Up @@ -242,6 +242,11 @@ protected function getOptions()
$db->setQuery($query);
$language = $db->loadResult();

if ($options[$i]->level != 0)
{
$options[$i]->level = $options[$i]->level -1;
}

if ($options[$i]->published == 1)
{
$options[$i]->text = str_repeat('- ', $options[$i]->level) . $options[$i]->text;
Expand Down
Expand Up @@ -14,7 +14,8 @@
/**
* Category Parent field.
*
* @since 1.6
* @since 1.6
* @deprecated 4.0 Use categoryedit instead.
*/
class JFormFieldCategoryParent extends JFormFieldList
{
Expand Down
Expand Up @@ -38,7 +38,7 @@
</label>
<div id="batch-choose-action" class="combo controls">
<select name="batch[category_id]" id="batch-category-id">
<option value=""><?php echo JText::_('JLIB_HTML_BATCH_NO_CATEGORY'); ?></option>
<option value=""><?php echo JText::_('JLIB_HTML_BATCH_NO_CATEGORY') ?></option>
<?php echo JHtml::_('select.options', JHtml::_('category.categories', $extension, array('filter.published' => $published))); ?>
</select>
</div>
Expand All @@ -55,4 +55,15 @@
</div>
</div>
</div>
<div class="row-fluid">
<div class="span6">
<div class="control-group">
<label id="flip-ordering-id-lbl" for="flip-ordering-id" class="control-label">
<?php echo JText::_('JLIB_HTML_BATCH_FLIPORDERING_LABEL'); ?>
</label>
<?php echo JHtml::_('select.booleanlist', 'batch[flip_ordering]', array(), 0, 'JYES', 'JNO', 'flip-ordering-id'); ?>
</div>
</div>
</div>
</div>

Expand Up @@ -118,7 +118,7 @@ public function display($tpl = null)
// In article associations modal we need to remove language filter if forcing a language.
if ($forcedLanguage = JFactory::getApplication()->input->get('forcedLanguage', '', 'CMD'))
{
// If the language is forced we can't allow to select the language, so transform the language selector filter into an hidden field.
// If the language is forced we can't allow to select the language, so transform the language selector filter into a hidden field.
$languageXml = new SimpleXMLElement('<field name="language" type="hidden" default="' . $forcedLanguage . '" />');
$this->filterForm->setField($languageXml, 'filter', true);

Expand Down

0 comments on commit 6fe4a6e

Please sign in to comment.