Skip to content

Commit

Permalink
Merge branch 'staging' of https://github.com/joomla/joomla-cms into c…
Browse files Browse the repository at this point in the history
…url-transport
  • Loading branch information
haydenyoung committed Aug 18, 2017
2 parents c942daa + 7e89ab4 commit a035418
Show file tree
Hide file tree
Showing 175 changed files with 770 additions and 5,779 deletions.
3 changes: 2 additions & 1 deletion .appveyor.yml
Expand Up @@ -91,10 +91,11 @@ 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
- appveyor-retry composer install --ignore-platform-reqs --no-progress --profile
- appveyor-retry composer install --no-progress --profile

before_test:
# Database setup for MySQL via PowerShell tools
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).
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
Expand Up @@ -2,5 +2,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, '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),
(480, 0, 'plg_sampledata_testing', 'plugin', 'testing', 'sampledata', 0, 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';
Expand Up @@ -2,5 +2,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, '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),
(480, 0, 'plg_sampledata_testing', 'plugin', 'testing', 'sampledata', 0, 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);
@@ -1,5 +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),
(480, 0, 'plg_sampledata_testing', 'plugin', 'testing', 'sampledata', 0, 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);
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
Expand Up @@ -128,7 +128,6 @@
<tbody>
<?php foreach ($this->items as $i => $item) : ?>
<?php
$orderkey = array_search($item->id, $this->ordering[$item->parent_id]);
$canEdit = $user->authorise('core.edit', $extension . '.category.' . $item->id);
$canCheckin = $user->authorise('core.admin', 'com_checkin') || $item->checked_out == $userId || $item->checked_out == 0;
$canEditOwn = $user->authorise('core.edit.own', $extension . '.category.' . $item->id) && $item->created_user_id == $userId;
Expand Down Expand Up @@ -177,7 +176,7 @@
<span class="icon-menu"></span>
</span>
<?php if ($canChange && $saveOrder) : ?>
<input type="text" style="display:none" name="order[]" size="5" value="<?php echo $orderkey + 1; ?>" />
<input type="text" style="display:none" name="order[]" size="5" value="<?php echo $item->lft; ?>" />
<?php endif; ?>
</td>
<td class="center">
Expand Down
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
Expand Up @@ -51,6 +51,7 @@ public static function association($contactid)
->select('cat.title as category_title')
->join('LEFT', '#__categories as cat ON cat.id=c.catid')
->where('c.id IN (' . implode(',', array_values($associations)) . ')')
->where('c.id != ' . $contactid)
->join('LEFT', '#__languages as l ON c.language=l.lang_code')
->select('l.image')
->select('l.title as language_title');
Expand Down
Expand Up @@ -104,7 +104,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 @@ -52,6 +52,7 @@ public static function association($articleid)
->select('cat.title as category_title')
->join('LEFT', '#__categories as cat ON cat.id=c.catid')
->where('c.id IN (' . implode(',', array_values($associations)) . ')')
->where('c.id != ' . $articleid)
->join('LEFT', '#__languages as l ON c.language=l.lang_code')
->select('l.image')
->select('l.title as language_title');
Expand Down
Expand Up @@ -120,7 +120,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
37 changes: 27 additions & 10 deletions administrator/components/com_fields/helpers/fields.php
Expand Up @@ -106,10 +106,12 @@ public static function getFields($context, $item = null, $prepareValue = false,
{
$item = (object) $item;
}
if (JLanguageMultilang::isEnabled() && isset($item->language) && $item->language !='*')

if (JLanguageMultilang::isEnabled() && isset($item->language) && $item->language != '*')
{
self::$fieldsCache->setState('filter.language', array('*', $item->language));
}

self::$fieldsCache->setState('filter.context', $context);

/*
Expand Down Expand Up @@ -146,7 +148,7 @@ public static function getFields($context, $item = null, $prepareValue = false,
}

$fieldIds = array_map(
function($f)
function ($f)
{
return $f->id;
},
Expand Down Expand Up @@ -305,6 +307,7 @@ public static function prepareForm($context, JForm $form, $data)
{
$assignedCatids = $firstChoice->getAttribute('value');
}

$data->fieldscatid = $assignedCatids;
}

Expand Down Expand Up @@ -333,7 +336,8 @@ function categoryHasChanged(element) {
Joomla.loadingLayer('load');
var formControl = '#" . $form->getFormControl() . "_catid';
if (!jQuery(formControl).val() != '" . $assignedCatids . "'){jQuery(formControl).val('" . $assignedCatids . "');}
});");
});"
);
}

// Getting the fields
Expand Down Expand Up @@ -600,9 +604,9 @@ public static function getAssignedCategoriesTitles($fieldId)
$query = $db->getQuery(true);

$query->select($db->quoteName('c.title'))
->from($db->quoteName('#__fields_categories', 'a'))
->join('LEFT', $db->quoteName('#__categories', 'c') . ' ON a.category_id = c.id')
->where('field_id = ' . $fieldId);
->from($db->quoteName('#__fields_categories', 'a'))
->join('LEFT', $db->quoteName('#__categories', 'c') . ' ON a.category_id = c.id')
->where('field_id = ' . $fieldId);

$db->setQuery($query);

Expand All @@ -620,10 +624,10 @@ public static function getFieldsPluginId()
{
$db = JFactory::getDbo();
$query = $db->getQuery(true)
->select($db->quoteName('extension_id'))
->from($db->quoteName('#__extensions'))
->where($db->quoteName('folder') . ' = ' . $db->quote('system'))
->where($db->quoteName('element') . ' = ' . $db->quote('fields'));
->select($db->quoteName('extension_id'))
->from($db->quoteName('#__extensions'))
->where($db->quoteName('folder') . ' = ' . $db->quote('system'))
->where($db->quoteName('element') . ' = ' . $db->quote('fields'));
$db->setQuery($query);

try
Expand Down Expand Up @@ -728,4 +732,17 @@ public static function getFieldTypes()

return $data;
}

/**
* Clears the internal cache for the custom fields.
*
* @return void
*
* @since 3.8.0
*/
public static function clearFieldsCache()
{
self::$fieldCache = null;
self::$fieldsCache = null;
}
}
7 changes: 7 additions & 0 deletions administrator/components/com_fields/models/field.php
Expand Up @@ -184,10 +184,12 @@ public function save($data)
if (is_object($oldParams) && is_object($newParams) && $oldParams != $newParams)
{
$names = array();

foreach ($newParams as $param)
{
$names[] = $db->q($param['value']);
}

$query = $db->getQuery(true);
$query->delete('#__fields_values')->where('field_id = ' . (int) $field->id)
->where('value NOT IN (' . implode(',', $names) . ')');
Expand All @@ -196,6 +198,8 @@ public function save($data)
}
}

FieldsHelper::clearFieldsCache();

return true;
}

Expand Down Expand Up @@ -642,6 +646,7 @@ public function setFieldValue($fieldId, $itemId, $value)
}

$this->valueCache = array();
FieldsHelper::clearFieldsCache();

return true;
}
Expand Down Expand Up @@ -940,12 +945,14 @@ protected function preprocessForm(JForm $form, $data, $group = 'content')

// Allow to override the default value label and description through the plugin
$key = 'PLG_FIELDS_' . strtoupper($dataObject->type) . '_DEFAULT_VALUE_LABEL';

if (JFactory::getLanguage()->hasKey($key))
{
$form->setFieldAttribute('default_value', 'label', $key);
}

$key = 'PLG_FIELDS_' . strtoupper($dataObject->type) . '_DEFAULT_VALUE_DESC';

if (JFactory::getLanguage()->hasKey($key))
{
$form->setFieldAttribute('default_value', 'description', $key);
Expand Down
3 changes: 2 additions & 1 deletion administrator/components/com_fields/models/fields.php
Expand Up @@ -240,6 +240,7 @@ protected function getListQuery()
$includeGroupState = !$app->isClient('administrator') ||
$app->input->get('option') != 'com_fields' ||
$app->input->get('view') != 'fields';

if (is_numeric($state))
{
$query->where('a.state = ' . (int) $state);
Expand Down Expand Up @@ -304,7 +305,7 @@ protected function getListQuery()
$listOrdering = $this->state->get('list.ordering', 'a.ordering');
$orderDirn = $this->state->get('list.direction', 'ASC');

$query->order($db->escape($listOrdering) . ' ' . $db->escape($orderDirn));
$query->order($db->escape($listOrdering) . ' ' . $db->escape($orderDirn));

return $query;
}
Expand Down
Expand Up @@ -55,6 +55,7 @@ protected function getOptions()
{
$option->text = '[' . $option->text . ']';
}

if ($option->state == 2)
{
$option->text = '{' . $option->text . '}';
Expand Down
7 changes: 4 additions & 3 deletions administrator/components/com_fields/models/fields/section.php
Expand Up @@ -50,17 +50,18 @@ public function setup(SimpleXMLElement $element, $value, $group = null)
*
* @since 3.7.0
*/
protected function getInput ()
protected function getInput()
{
// Add the change context function to the document
JFactory::getDocument()->addScriptDeclaration(
"function fieldsChangeContext(context)
"function fieldsChangeContext(context)
{
var regex = new RegExp(\"([?;&])context[^&;]*[;&]?\");
var url = window.location.href;
var query = url.replace(regex, \"$1\").replace(/&$/, '');
window.location.href = (query.length > 2 ? query + \"&\" : \"?\") + (context ? \"context=\" + context : '');
}");
}"
);

return parent::getInput();
}
Expand Down
3 changes: 2 additions & 1 deletion administrator/components/com_fields/models/fields/type.php
Expand Up @@ -78,7 +78,8 @@ function typeHasChanged(element){
jQuery('input[name=task]').val('field.reload');
element.form.submit();
}
");
"
);

return $options;
}
Expand Down

0 comments on commit a035418

Please sign in to comment.