Skip to content

Commit

Permalink
Merge branch 'joomla:4.1-dev' into translation
Browse files Browse the repository at this point in the history
  • Loading branch information
joomla-translation-bot committed May 10, 2022
2 parents f2031a2 + be02e31 commit 65ba06e
Show file tree
Hide file tree
Showing 312 changed files with 2,230 additions and 878 deletions.
87 changes: 27 additions & 60 deletions .appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,89 +1,56 @@
image: Visual Studio 2022
build: false
platform:
- x64
clone_folder: C:\projects\joomla-cms

branches:
except:
- /l10n_*/

## Build matrix for lowest and highest possible targets
environment:
PHPBuild: "x64"
VC: "vc15"
WINCACHE: "2.0.0.8"
matrix:
- php_ver_target: 7.2
- php_ver_target: 7.3
- php_ver_target: 7.4
- php_ver_target: 8.0


init:
- SET PATH=C:\Program Files\OpenSSL;C:\tools\php;%PATH%
- SET PATH=C:\Tools\php;%PATH%
- SET COMPOSER_NO_INTERACTION=1
- SET PHP=1 # This var relates to caching the php install
- SET ANSICON=121x90 (121x90)
services:
- mysql
- postgresql94
- iis

## Install PHP and composer, and run the appropriate composer command
install:
- IF EXIST C:\tools\php (SET PHP=0)
# @todo: This is a workaround for https://github.com/chocolatey/choco/issues/1843. Once this is fixed we
# should go back to latest version in appveyor saving ourselves test time
- ps: choco upgrade chocolatey -y --version 0.10.13 --allow-downgrade --no-progress
- ps: >-
If ($env:PHP -eq "1") {
appveyor-retry cinst --no-progress --params '""/InstallDir:C:\tools\php""' --ignore-checksums -y php --version ((choco search php --exact --all-versions -r | select-string -pattern $env:php_ver_target | sort { [version]($_ -split '\|' | select -last 1) } -Descending | Select-Object -first 1) -replace '[php|]','')
}
appveyor-retry choco install --no-progress --params '""/InstallDir:C:\tools\php""' --ignore-checksums -y php --version ((choco search php --exact --all-versions -r | select-string -pattern $env:php_ver_target | sort { [version]($_ -split '\|' | select -last 1) } -Descending | Select-Object -first 1) -replace '[php|]','')
- 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_gmp.dll >> php.ini
- 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_mysql.dll >> php.ini
- IF %PHP%==1 echo extension=php_mysqli.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" -and $env:WINCACHE) {
cd c:\tools\php\ext
$source = "https://windows.php.net/downloads/pecl/releases/wincache/$($env:WINCACHE)/php_wincache-$($env:WINCACHE)-$($env:php_ver_target)-nts-$($env:VC)-$($env:PHPBuild).zip"
$destination = "c:\tools\php\ext\php_wincache-$($env:WINCACHE)-$($env:php_ver_target)-nts-$($env:VC)-$($env:PHPBuild).zip"
Invoke-WebRequest $source -OutFile $destination
#appveyor-retry appveyor DownloadFile https://windows.php.net/downloads/pecl/releases/wincache/$($env:WINCACHE)/php_wincache-$($env:WINCACHE)-$($env:php_ver_target)-nts-$($env:VC)-$($env:PHPBuild).zip
7z x -y php_wincache-$($env:WINCACHE)-$($env:php_ver_target)-nts-$($env:VC)-$($env:PHPBuild).zip > $null
Remove-Item C:\tools\php\ext* -include .zip
cd c:\tools\php
Add-Content php.ini "`nextension=php_wincache.dll"
Add-Content php.ini "`wincache.enablecli = 1"
Add-Content php.ini "`n"
}
- 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
- IF %PHP%==1 appveyor-retry appveyor DownloadFile https://getcomposer.org/download/latest-1.x/composer.phar
- copy php.ini-production php.ini /Y
- echo date.timezone="UTC" >> php.ini
- echo extension_dir=ext >> php.ini
- echo extension=php_openssl.dll >> php.ini
- echo extension=php_mbstring.dll >> php.ini
- echo extension=php_fileinfo.dll >> php.ini
- IF %php_ver_target% LSS 8 echo extension=php_gd2.dll >> php.ini
- IF %php_ver_target% GEQ 8 echo extension=gd >> php.ini
- echo extension=php_gmp.dll >> php.ini
- echo extension=php_pgsql.dll >> php.ini
- echo extension=php_pdo_pgsql.dll >> php.ini
- echo extension=php_pdo_mysql.dll >> php.ini
- echo extension=php_mysqli.dll >> php.ini
- echo extension=php_curl.dll >> php.ini
- echo zend_extension=php_opcache.dll >> php.ini
- echo opcache.enable_cli=1 >> php.ini
- echo extension=php_ldap.dll >> php.ini
- choco install composer
- cd C:\projects\joomla-cms
- appveyor-retry composer install --no-progress --profile
- refreshenv
- composer install --no-progress --profile
before_test:
# Database setup for MySQL via PowerShell tools
- >
"C:\Program Files\MySQL\MySQL Server 5.7\bin\mysql" -u root -p"Password12!" -e "CREATE DATABASE IF NOT EXISTS joomla_ut;"
# Database setup for PostgreSQL
- SET PGUSER=postgres
- SET PGPASSWORD=Password12!
- PATH=C:\Program Files\PostgreSQL\9.4\bin\;%PATH%
- createdb joomla_ut
"C:\Program Files\MySQL\MySQL Server 5.7\bin\mysql" -u root -p"Password12!" -e "CREATE DATABASE IF NOT EXISTS test_joomla;"
test_script:
- cd C:\projects\joomla-cms
- libraries/vendor/bin/phpunit --testsuite Unit
- libraries/vendor/bin/phpunit --testsuite Integration --configuration tests/phpunit-appveyor.xml.dist
7 changes: 3 additions & 4 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,13 @@ clone:

steps:
- name: composer
image: joomlaprojects/docker-images:php7.3
image: joomlaprojects/docker-images:php7.4
volumes:
- name: composer-cache
path: /tmp/composer-cache
commands:
- composer validate --no-check-all --strict
- composer install --no-progress --no-suggest
- patch -N -p0 < tests/patch/phpunit8_php8_match.patch || echo "Ignore this error."
- composer install --no-progress

- name: phpcs
image: joomlaprojects/docker-images:php7.2
Expand Down Expand Up @@ -420,6 +419,6 @@ steps:

---
kind: signature
hmac: a6f3f2ed21261b612d052724e5f43a5dd55168f98cbaa48eeaa358816bb255df
hmac: 15e1abb49597a83c250c8785948aa9fa0c6d93ec88b03e45c30d8050b338ea5d

...
4 changes: 2 additions & 2 deletions .github/workflows/create-translation-pull-request-v4.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ jobs:
# We use a simple copy paste syntax here if needed customization for different directories
run: |
cd ..
SYNC_VERION="v4"
SYNC_VERSION="v4"
SYNC_PATH="installation/language/"
echo ${SYNC_PATH}
rsync -i -rptgo --checksum --ignore-times --delete --exclude="*en-GB*" core-translations-main/joomla_${SYNC_VERION}/translations/core/${SYNC_PATH} joomla-cms/${SYNC_PATH}
rsync -i -rptgo --checksum --ignore-times --delete --exclude="*en-GB*" core-translations-main/joomla_${SYNC_VERSION}/translations/core/${SYNC_PATH} joomla-cms/${SYNC_PATH}
- name: Update static error pages
run: |
Expand Down
46 changes: 46 additions & 0 deletions administrator/components/com_admin/script.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ public function update($installer)
$this->updateAssets($installer);
$this->clearStatsCache();
$this->convertTablesToUtf8mb4(true);
$this->addUserAuthProviderColumn();
$this->cleanJoomlaCache();
}

Expand Down Expand Up @@ -706,6 +707,7 @@ public function deleteUnexistingFiles($dryRun = false, $suppressOutput = false)
'/administrator/components/com_admin/sql/updates/mysql/3.10.0-2020-08-10.sql',
'/administrator/components/com_admin/sql/updates/mysql/3.10.0-2021-05-28.sql',
'/administrator/components/com_admin/sql/updates/mysql/3.10.7-2022-02-20.sql',
'/administrator/components/com_admin/sql/updates/mysql/3.10.7-2022-03-18.sql',
'/administrator/components/com_admin/sql/updates/mysql/3.2.0.sql',
'/administrator/components/com_admin/sql/updates/mysql/3.2.1.sql',
'/administrator/components/com_admin/sql/updates/mysql/3.2.2-2013-12-22.sql',
Expand Down Expand Up @@ -828,7 +830,9 @@ public function deleteUnexistingFiles($dryRun = false, $suppressOutput = false)
'/administrator/components/com_admin/sql/updates/postgresql/3.1.5.sql',
'/administrator/components/com_admin/sql/updates/postgresql/3.10.0-2020-08-10.sql',
'/administrator/components/com_admin/sql/updates/postgresql/3.10.0-2021-05-28.sql',
'/administrator/components/com_admin/sql/updates/postgresql/3.10.7-2022-02-20.sql',
'/administrator/components/com_admin/sql/updates/postgresql/3.10.7-2022-02-20.sql.sql',
'/administrator/components/com_admin/sql/updates/postgresql/3.10.7-2022-03-18.sql',
'/administrator/components/com_admin/sql/updates/postgresql/3.2.0.sql',
'/administrator/components/com_admin/sql/updates/postgresql/3.2.1.sql',
'/administrator/components/com_admin/sql/updates/postgresql/3.2.2-2013-12-22.sql',
Expand Down Expand Up @@ -953,7 +957,9 @@ public function deleteUnexistingFiles($dryRun = false, $suppressOutput = false)
'/administrator/components/com_admin/sql/updates/sqlazure/3.1.5.sql',
'/administrator/components/com_admin/sql/updates/sqlazure/3.10.0-2021-05-28.sql',
'/administrator/components/com_admin/sql/updates/sqlazure/3.10.1-2021-08-17.sql',
'/administrator/components/com_admin/sql/updates/sqlazure/3.10.7-2022-02-20.sql',
'/administrator/components/com_admin/sql/updates/sqlazure/3.10.7-2022-02-20.sql.sql',
'/administrator/components/com_admin/sql/updates/sqlazure/3.10.7-2022-03-18.sql',
'/administrator/components/com_admin/sql/updates/sqlazure/3.2.0.sql',
'/administrator/components/com_admin/sql/updates/sqlazure/3.2.1.sql',
'/administrator/components/com_admin/sql/updates/sqlazure/3.2.2-2013-12-22.sql',
Expand Down Expand Up @@ -6377,6 +6383,10 @@ public function deleteUnexistingFiles($dryRun = false, $suppressOutput = false)
'/libraries/vendor/tobscure/json-api/tests/ParametersTest.php',
'/libraries/vendor/tobscure/json-api/tests/ResourceTest.php',
'/libraries/vendor/tobscure/json-api/tests/UtilTest.php',
// From 4.1.1 to 4.1.2
'/administrator/components/com_users/src/Field/PrimaryauthprovidersField.php',
// From 4.1.2 to 4.1.3
'/libraries/vendor/webmozart/assert/.php_cs',
);

$folders = array(
Expand Down Expand Up @@ -8643,4 +8653,40 @@ function ($template) use ($db)
['atum', 'cassiopeia']
);
}

/**
* Add the user Auth Provider Column as it could be present from 3.10 already
*
* @return void
*
* @since 4.1.1
*/
protected function addUserAuthProviderColumn(): void
{
$db = Factory::getContainer()->get('DatabaseDriver');

// Check if the column already exists
$fields = $db->getTableColumns('#__users');

// Column exists, skip
if (isset($fields['authProvider']))
{
return;
}

$query = 'ALTER TABLE ' . $db->quoteName('#__users')
. ' ADD COLUMN ' . $db->quoteName('authProvider') . ' varchar(100) DEFAULT ' . $db->quote('') . ' NOT NULL';

// Add column
try
{
$db->setQuery($query)->execute();
}
catch (Exception $e)
{
echo Text::sprintf('JLIB_DATABASE_ERROR_FUNCTION_FAILED', $e->getCode(), $e->getMessage()) . '<br>';

return;
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
UPDATE `#__mail_templates`
SET `params` = '{"tags":["message","date","extension","username"]}'
WHERE `template_id` = 'com_actionlogs.notification' AND `params` = '{"tags":["message","date","extension"]}';

UPDATE `#__mail_templates`
SET `params` = '{"tags":["sitename","name","email","subject","body","url","customfields","contactname"]}'
WHERE `template_id` = 'com_contact.mail.copy' AND `params` = '{"tags":["sitename","name","email","subject","body","url","customfields"]}';
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
UPDATE `#__update_sites`
SET `name` = 'Joomla! Update Component'
WHERE `name` = 'Joomla! Update Component Update Site';
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
UPDATE "#__mail_templates"
SET "params" = '{"tags":["message","date","extension","username"]}'
WHERE "template_id" = 'com_actionlogs.notification' AND "params" = '{"tags":["message","date","extension"]}';

UPDATE "#__mail_templates"
SET "params" = '{"tags":["sitename","name","email","subject","body","url","customfields","contactname"]}'
WHERE "template_id" = 'com_contact.mail.copy' AND "params" = '{"tags":["sitename","name","email","subject","body","url","customfields"]}';
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
UPDATE "#__update_sites"
SET "name" = 'Joomla! Update Component'
WHERE "name" = 'Joomla! Update Component Update Site';
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ public function checkin()
return;
}

$cid = $this->input->get('cid', array(), 'array');
$cid = (array) $this->input->get('cid', array(), 'int');

if (empty($cid))
{
Expand All @@ -118,6 +118,12 @@ public function checkin()
// We know the first element is the one we need because we don't allow multi selection of rows
$id = $cid[0];

if ($id === 0)
{
// Seems we don't have an id to work with.
return;
}

if (AssociationsHelper::canCheckinItem($extensionName, $typeName, $id) === true)
{
$item = AssociationsHelper::getItem($extensionName, $typeName, $id);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,14 @@ public function sticky_publish()
// Check for request forgeries.
$this->checkToken();

$ids = $this->input->get('cid', array(), 'array');
$ids = (array) $this->input->get('cid', array(), 'int');
$values = array('sticky_publish' => 1, 'sticky_unpublish' => 0);
$task = $this->getTask();
$value = ArrayHelper::getValue($values, $task, 0, 'int');

// Remove zero values resulting from input filter
$ids = array_filter($ids);

if (empty($ids))
{
$this->app->enqueueMessage(Text::_('COM_BANNERS_NO_BANNERS_SELECTED'), 'warning');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@

/** @var \Joomla\Component\Banners\Administrator\View\Banners\HtmlView $this */

HTMLHelper::_('behavior.multiselect');
/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */
$wa = $this->document->getWebAssetManager();
$wa->useScript('multiselect');

$user = Factory::getUser();
$userId = $user->get('id');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@

/** @var \Joomla\Component\Banners\Administrator\View\Clients\HtmlView $this */

HTMLHelper::_('behavior.multiselect');
/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */
$wa = $this->document->getWebAssetManager();
$wa->useScript('multiselect');

$purchaseTypes = [
'1' => 'UNLIMITED',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@

/** @var \Joomla\Component\Banners\Administrator\View\Download\HtmlView $this */

HTMLHelper::_('behavior.formvalidator');
/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */
$wa = $this->document->getWebAssetManager();
$wa->useScript('form.validate');

?>
<div class="container-popup">
Expand Down
3 changes: 2 additions & 1 deletion administrator/components/com_cache/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
filter="rules"
validate="rules"
component="com_cache"
section="component" />
section="component"
/>
</fieldset>
</config>
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public function delete()
// Check for request forgeries
$this->checkToken();

$cid = $this->input->post->get('cid', array(), 'array');
$cid = (array) $this->input->post->get('cid', array(), 'string');

if (empty($cid))
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@
use Joomla\CMS\Session\Session;
use Joomla\String\Inflector;

HTMLHelper::_('behavior.multiselect');
/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */
$wa = $this->document->getWebAssetManager();
$wa->useScript('multiselect');

$user = Factory::getUser();
$userId = $user->get('id');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public function checkin()
// Check for request forgeries
$this->checkToken();

$ids = $this->input->get('cid', array(), 'array');
$ids = (array) $this->input->get('cid', array(), 'string');

if (empty($ids))
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@
use Joomla\CMS\Layout\LayoutHelper;
use Joomla\CMS\Router\Route;

HTMLHelper::_('behavior.multiselect');
/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */
$wa = $this->document->getWebAssetManager();
$wa->useScript('multiselect');

$listOrder = $this->escape($this->state->get('list.ordering'));
$listDirn = $this->escape($this->state->get('list.direction'));
Expand Down

0 comments on commit 65ba06e

Please sign in to comment.