Skip to content

Commit

Permalink
Merge branch 'staging' into 3.8-dev
Browse files Browse the repository at this point in the history
  • Loading branch information
wilsonge committed Feb 14, 2017
2 parents 739e62d + cbae8f4 commit 185fe30
Show file tree
Hide file tree
Showing 149 changed files with 2,265 additions and 1,546 deletions.
76 changes: 48 additions & 28 deletions .appveyor.yml
@@ -1,5 +1,4 @@
build: false
shallow_clone: true
platform:
- x64
clone_folder: C:\projects\joomla-cms
Expand All @@ -13,7 +12,7 @@ environment:
init:
- SET PATH=C:\Program Files\OpenSSL;C:\tools\php;%PATH%
- SET COMPOSER_NO_INTERACTION=1
- SET PHP=1
- SET PHP=1 # This var relates to caching the php install
- SET ANSICON=121x90 (121x90)
services:
- mssql2014
Expand All @@ -26,51 +25,72 @@ install:
- IF EXIST C:\tools\php (SET PHP=0)
- ps: >-
If ($env:php_ver_target -eq "5.6") {
appveyor-retry cinst --ignore-checksums -y --forcex86 php --version ((choco search php --exact --all-versions -r | select-string -pattern $Env:php_ver_target | Select-Object -first 1) -replace '[php|]','')
appveyor-retry cinst --ignore-checksums -y --forcex86 php --version ((choco search php --exact --all-versions -r | select-string -pattern $Env:php_ver_target | Select-Object -first 1) -replace '[php|]','')
$VC = "vc11"
$PHPBuild = "x86"
} Else {
appveyor-retry cinst --ignore-checksums -y php --version ((choco search php --exact --all-versions -r | select-string -pattern $Env:php_ver_target | Select-Object -first 1) -replace '[php|]','')}
appveyor-retry cinst --ignore-checksums -y php --version ((choco search php --exact --all-versions -r | select-string -pattern $Env:php_ver_target | Select-Object -first 1) -replace '[php|]','')
$VC = "vc14"
$PHPBuild = "x64"
}
- cinst -y sqlite
- cd C:\tools\php
# Get the MSSQL DLL's
- ps: >-
If ($env:php_ver_target -eq "5.6") {
If ($env:PHP -eq "1") {
If ($env:PHP -eq "1") {
If ($env:php_ver_target -eq "5.6") {
appveyor DownloadFile https://files.nette.org/misc/php-sqlsrv.zip
7z x php-sqlsrv.zip > $null
7z x -y php-sqlsrv.zip > $null
copy SQLSRV\php_sqlsrv_56_nts.dll ext\php_sqlsrv_nts.dll
copy SQLSRV\php_pdo_sqlsrv_56_nts.dll ext\php_pdo_sqlsrv_nts.dll
Remove-Item C:\tools\php\* -include .zip}}
- ps: >-
If ($env:php_ver_target -eq "7.0") {
If ($env:PHP -eq "1") {
appveyor DownloadFile https://github.com/Microsoft/msphpsql/releases/download/4.1.5-Windows/7.0.zip
7z x 7.0.zip > $null
copy 7.0\x64\php_pdo_sqlsrv_7_nts.dll ext\php_pdo_sqlsrv_nts.dll
copy 7.0\x64\php_sqlsrv_7_nts.dll ext\php_sqlsrv_nts.dll
Remove-Item C:\tools\php\* -include .zip}}
- ps: >-
If ($env:php_ver_target -eq "7.1") {
If ($env:PHP -eq "1") {
appveyor DownloadFile https://github.com/Microsoft/msphpsql/releases/download/4.1.5-Windows/7.1.zip
7z x 7.1.zip > $null
copy 7.1\x64\php_pdo_sqlsrv_71_nts.dll ext\php_pdo_sqlsrv_nts.dll
copy 7.1\x64\php_sqlsrv_71_nts.dll ext\php_sqlsrv_nts.dll
Remove-Item C:\tools\php\* -include .zip}}
Remove-Item C:\tools\php\* -include .zip
} Else {
$DLLVersion = "4.1.6.1"
cd c:\tools\php\ext
appveyor-retry appveyor DownloadFile http://windows.php.net/downloads/pecl/releases/sqlsrv/$($DLLVersion)/php_sqlsrv-$($DLLVersion)-$($env:php_ver_target)-nts-vc14-x64.zip
7z x -y php_sqlsrv-$($DLLVersion)-$($env:php_ver_target)-nts-vc14-x64.zip > $null
appveyor-retry appveyor DownloadFile http://windows.php.net/downloads/pecl/releases/pdo_sqlsrv/$($DLLVersion)/php_pdo_sqlsrv-$($DLLVersion)-$($env:php_ver_target)-nts-vc14-x64.zip
7z x -y php_pdo_sqlsrv-$($DLLVersion)-$($env:php_ver_target)-nts-vc14-x64.zip > $null
Remove-Item c:\tools\php\ext* -include .zip
cd c:\tools\php}}
- IF %PHP%==1 copy php.ini-production php.ini /Y
- IF %PHP%==1 echo date.timezone="UTC" >> php.ini
- IF %PHP%==1 echo extension_dir=ext >> php.ini
- IF %PHP%==1 echo extension=php_openssl.dll >> php.ini
- IF %PHP%==1 echo extension=php_mbstring.dll >> php.ini
- IF %PHP%==1 echo extension=php_fileinfo.dll >> php.ini
- IF %PHP%==1 echo extension=php_gd2.dll >> php.ini
- IF %PHP%==1 echo extension=php_pdo_mysql.dll >> php.ini
- IF %PHP%==1 echo extension=php_pdo_sqlsrv_nts.dll >> php.ini
- IF %PHP%==1 echo extension=php_sqlsrv_nts.dll >> php.ini
- ps: >-
If ($env:php_ver_target -eq "5.6") {
Add-Content php.ini "`nextension=php_sqlsrv_nts.dll"
Add-Content php.ini "`nextension=php_pdo_sqlsrv_nts.dll"
Add-Content php.ini "`n"
} Else {
Add-Content php.ini "`nextension=php_sqlsrv.dll"
Add-Content php.ini "`nextension=php_pdo_sqlsrv.dll"
Add-Content php.ini "`n"
}
- IF %PHP%==1 echo extension=php_pgsql.dll >> php.ini
- IF %PHP%==1 echo extension=php_pdo_pgsql.dll >> php.ini
- IF %PHP%==1 echo extension=php_pdo_sqlite.dll >> php.ini
- IF %PHP%==1 echo extension=php_sqlite3.dll >> php.ini
- IF %PHP%==1 echo extension=php_pdo_mysql.dll >> php.ini
- IF %PHP%==1 echo extension=php_mysqli.dll >> php.ini
- IF %PHP%==1 echo extension=php_pgsql.dll >> php.ini
- IF %PHP_VER_TARGET%==5.6 IF %PHP%==1 echo extension=php_mysql.dll >> php.ini
- IF %PHP%==1 echo extension=php_curl.dll >> php.ini
# Get the Wincache DLLs
- ps: >-
If ($env:PHP -eq "1") {
If ($env:php_ver_target -eq "5.6") {$wincache = "1.3.7.12"} Else {$wincache = "2.0.0.8"}
cd c:\tools\php\ext
appveyor DownloadFile http://windows.php.net/downloads/pecl/releases/wincache/$($wincache)/php_wincache-$($wincache)-$($env:php_ver_target)-nts-$($VC)-$($PHPBuild).zip
7z x -y php_wincache-$($wincache)-$($env:php_ver_target)-nts-$($VC)-$($PHPBuild).zip > $null
Remove-Item C:\tools\php\ext* -include .zip
cd c:\tools\php}
- IF %PHP%==1 echo extension=php_wincache.dll >> php.ini
- 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 @php %%~dp0composer.phar %%* > composer.bat
- appveyor-retry appveyor DownloadFile https://getcomposer.org/composer.phar
- cd C:\projects\joomla-cms
Expand Down
40 changes: 26 additions & 14 deletions .drone.yml
@@ -1,16 +1,28 @@
build:
image: joomlaprojects/docker-systemtests:latest
commands:
- apt-get install nodejs npm
- ln -s /usr/bin/nodejs /usr/bin/node
- export DISPLAY=:0
- Xvfb -screen 0 1024x768x24 -ac +extension GLX +render -noreset > /dev/null 2>&1 &
- sleep 3
- fluxbox > /dev/null 2>&1 &
- cd tests/javascript
- npm install
- cd ../..
- tests/javascript/node_modules/karma/bin/karma start karma.conf.js --single-run
pipeline:
clone:
image: plugins/git
depth: 1
path: repo

phpcs:
image: joomlaprojects/docker-phpcs
commands:
- echo $(date)
- /root/.composer/vendor/bin/phpcs --report=full --extensions=php -p --standard=build/phpcs/Joomla .
- echo $(date)

javascript:
image: joomlaprojects/docker-systemtests:latest
commands:
- echo $(date)
- apt-get install nodejs npm
- ln -s /usr/bin/nodejs /usr/bin/node
- export DISPLAY=:0
- Xvfb -screen 0 1024x768x24 -ac +extension GLX +render -noreset > /dev/null 2>&1 &
- sleep 3
- fluxbox > /dev/null 2>&1 &
- cd tests/javascript
- npm install
- cd ../..
- tests/javascript/node_modules/karma/bin/karma start karma.conf.js --single-run
- echo $(date)

9 changes: 9 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Expand Up @@ -2,10 +2,19 @@ Pull Request for Issue # .

### Summary of Changes



### Testing Instructions



### Expected result



### Actual result



### Documentation Changes Required

6 changes: 1 addition & 5 deletions .travis.yml
Expand Up @@ -5,7 +5,6 @@ language: php

env:
global:
- RUN_PHPCS="no"
- RUN_UNIT_TESTS="yes"
- RUN_JAVASCRIPT_TESTS="no"
- INSTALL_MEMCACHE="yes"
Expand All @@ -15,8 +14,6 @@ env:
matrix:
fast_finish: true
include:
- php: 5.6
env: RUN_PHPCS="yes" RUN_UNIT_TESTS="no" INSTALL_MEMCACHE="no" INSTALL_MEMCACHED="no" INSTALL_REDIS="no"
- php: 5.3
env: INSTALL_APC="yes"
- php: 5.4
Expand Down Expand Up @@ -60,10 +57,9 @@ before_script:
# JavaScript tests
- if [[ $RUN_JAVASCRIPT_TESTS == "yes" ]]; then export DISPLAY=:99.0; bash build/travis/javascript-tests.sh $PWD; fi
# Make sure all dev dependencies are installed
- if [[ ( $RUN_UNIT_TESTS == "yes" ) || ( $RUN_PHPCS == "yes" ) ]]; then bash build/travis/unit-tests.sh $PWD; fi
- if [[ $RUN_UNIT_TESTS == "yes" ]]; then bash build/travis/unit-tests.sh $PWD; fi

script:
- if [[ $RUN_PHPCS == "yes" ]]; then libraries/vendor/bin/phpcs --report=full --extensions=php -p --standard=build/phpcs/Joomla .; fi
- if [[ $RUN_UNIT_TESTS == "yes" ]]; then libraries/vendor/bin/phpunit --configuration travisci-phpunit.xml; fi
- if [[ $RUN_JAVASCRIPT_TESTS == "yes" ]]; then tests/javascript/node_modules/karma/bin/karma start karma.conf.js --single-run ; fi

Expand Down
4 changes: 4 additions & 0 deletions README.md
Expand Up @@ -4,7 +4,11 @@ Joomla! CMS™ [![Analytics](https://ga-beacon.appspot.com/UA-544070-3/joomla-cm
Build Status
---------------------
Travis-CI: [![Build Status](https://travis-ci.org/joomla/joomla-cms.svg?branch=staging)](https://travis-ci.org/joomla/joomla-cms)

Drone -CI: [![Build Status](http://213.160.72.75/api/badges/joomla/joomla-cms/status.svg)](http://213.160.72.75/joomla/joomla-cms)

AppVeyor: [![Build status](https://ci.appveyor.com/api/projects/status/bpcxulw6nnxlv8kb/branch/staging?svg=true)](https://ci.appveyor.com/project/joomla/joomla-cms)

Jenkins: [![Build Status](http://build.joomla.org/job/cms/badge/icon)](http://build.joomla.org/job/cms/)

What is this?
Expand Down
Expand Up @@ -16,6 +16,7 @@
JHtml::_('bootstrap.tooltip');
JHtml::_('behavior.formvalidator');
JHtml::_('behavior.keepalive');
JHtml::_('formbehavior.chosen', '.chzn-custom-value', null, array('disable_search_threshold' => 0));
JHtml::_('formbehavior.chosen', 'select');

// Load JS message titles
Expand Down
6 changes: 3 additions & 3 deletions administrator/components/com_contact/contact.xml
Expand Up @@ -35,16 +35,16 @@
</languages>

<administration>
<menu img="class:contact">com_contact</menu>
<menu img="class:contact">COM_CONTACT</menu>
<submenu>
<!--
Note that all & must be escaped to &amp; for the file to be valid
XML and be parsed by the installer
-->
<menu link="option=com_contact" img="class:contact"
alt="Contact/Contacts">com_contact_contacts</menu>
alt="Contact/Contacts">COM_CONTACT_CONTACTS</menu>
<menu link="option=com_categories&amp;extension=com_contact"
view="categories" img="class:contact-cat" alt="Contacts/Categories">com_contact_categories</menu>
view="categories" img="class:contact-cat" alt="Contacts/Categories">COM_CONTACT_CATEGORIES</menu>
</submenu>
<files folder="admin">
<filename>access.xml</filename>
Expand Down
5 changes: 3 additions & 2 deletions administrator/components/com_contact/helpers/contact.php
Expand Up @@ -181,14 +181,15 @@ public static function countTagItems(&$items, $extension)
* is returned.
*
* @param string $section The section to get the mapping for
* @param object $item optional item object
*
* @return string|null The new section
*
* @since 3.7.0
*/
public static function validateSection($section)
public static function validateSection($section, $item)
{
if (JFactory::getApplication()->isClient('site') && $section == 'contact')
if (JFactory::getApplication()->isClient('site') && $section == 'contact' && $item instanceof JForm)
{
// The contact form needs to be the mail section
$section = 'mail';
Expand Down
5 changes: 3 additions & 2 deletions administrator/components/com_fields/helpers/fields.php
Expand Up @@ -26,12 +26,13 @@ class FieldsHelper
* be in the format component.context.
*
* @param string $contextString contextString
* @param object $item optional item object
*
* @return array|null
*
* @since 3.7.0
*/
public static function extract($contextString)
public static function extract($contextString, $item = null)
{
$parts = explode('.', $contextString, 2);

Expand All @@ -53,7 +54,7 @@ public static function extract($contextString)

if (class_exists($cName) && is_callable(array($cName, 'validateSection')))
{
$section = call_user_func_array(array($cName, 'validateSection'), array($parts[1]));
$section = call_user_func_array(array($cName, 'validateSection'), array($parts[1], $item));

if ($section)
{
Expand Down
44 changes: 23 additions & 21 deletions administrator/components/com_login/models/login.php
Expand Up @@ -127,20 +127,14 @@ protected static function _load($module)
return $clean;
}

$app = JFactory::getApplication();
$lang = JFactory::getLanguage()->getTag();
$app = JFactory::getApplication();
$lang = JFactory::getLanguage()->getTag();
$clientId = (int) $app->getClientId();

$cache = JFactory::getCache('com_modules', '');
$cacheid = md5(serialize(array($clientId, $lang)));
$loginmodule = array();
/** @var JCacheControllerCallback $cache */
$cache = JFactory::getCache('com_modules', 'callback');

if ($cache->contains($cacheid))
{
$clean = $cache->get($cacheid);
}
else
{
$loader = function () use ($app, $lang, $module) {
$db = JFactory::getDbo();

$query = $db->getQuery(true)
Expand All @@ -161,23 +155,31 @@ protected static function _load($module)
// Set the query.
$db->setQuery($query);

return $db->loadObjectList();
};

try
{
return $clean = $cache->get($loader, array(), md5(serialize(array($clientId, $lang))));
}
catch (JCacheException $cacheException)
{
try
{
$modules = $db->loadObjectList();
return $loader();
}
catch (RuntimeException $e)
catch (JDatabaseExceptionExecuting $databaseException)
{
JError::raiseWarning(500, JText::sprintf('JLIB_APPLICATION_ERROR_MODULE_LOAD', $e->getMessage()));
JError::raiseWarning(500, JText::sprintf('JLIB_APPLICATION_ERROR_MODULE_LOAD', $databaseException->getMessage()));

return $loginmodule;
return array();
}

// Return to simple indexing that matches the query order.
$loginmodule = $modules;

$cache->store($loginmodule, $cacheid);
}
catch (JDatabaseExceptionExecuting $databaseException)
{
JError::raiseWarning(500, JText::sprintf('JLIB_APPLICATION_ERROR_MODULE_LOAD', $databaseException->getMessage()));

return $loginmodule;
return array();
}
}
}
Expand Up @@ -24,7 +24,7 @@
<ul class="menu-links">

<?php foreach ($menuTypes as &$type) : ?>
<li class="span3">
<li>
<div class="menu-links-block">
<button class="btn" type="button" class="jform-rightbtn" onclick="jQuery('.<?php echo $type->menutype; ?>').attr('checked', !jQuery('.<?php echo $type->menutype; ?>').attr('checked'));">
<span class="icon-checkbox-partial"></span> <?php echo JText::_('JGLOBAL_SELECTION_INVERT'); ?>
Expand Down
Expand Up @@ -9,15 +9,19 @@

defined('_JEXEC') or die;
?>
<div id="template-manager-copy" class="form-horizontal">
<div class="control-group">
<div class="control-label">
<label for="new_name" class="modalTooltip" title="<?php echo JHtml::_('tooltipText', 'COM_TEMPLATES_TEMPLATE_NEW_NAME_LABEL', 'COM_TEMPLATES_TEMPLATE_NEW_NAME_DESC'); ?>">
<?php echo JText::_('COM_TEMPLATES_TEMPLATE_NEW_NAME_LABEL'); ?>
</label>
</div>
<div class="controls">
<input class="input-xlarge" type="text" id="new_name" name="new_name" />
<div id="template-manager-copy" class="container-fluid">
<div class="row-fluid">
<div class="form-horizontal">
<div class="control-group">
<div class="control-label">
<label for="new_name" class="modalTooltip" title="<?php echo JHtml::_('tooltipText', 'COM_TEMPLATES_TEMPLATE_NEW_NAME_LABEL', 'COM_TEMPLATES_TEMPLATE_NEW_NAME_DESC'); ?>">
<?php echo JText::_('COM_TEMPLATES_TEMPLATE_NEW_NAME_LABEL'); ?>
</label>
</div>
<div class="controls">
<input class="input-xlarge" type="text" id="new_name" name="new_name" />
</div>
</div>
</div>
</div>
</div>

0 comments on commit 185fe30

Please sign in to comment.