Skip to content

Commit

Permalink
Merge branch '4.3-dev' into feature/support_filter_state_for_trash_bu…
Browse files Browse the repository at this point in the history
…tton
  • Loading branch information
HLeithner committed Sep 26, 2022
2 parents 7ad9d1d + f19fa75 commit 0e08760
Show file tree
Hide file tree
Showing 297 changed files with 2,851 additions and 1,508 deletions.
32 changes: 28 additions & 4 deletions .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,10 @@ environment:
matrix:
- php_ver_target: 8.0


init:
- SET PATH=C:\Tools\php;%PATH%
- SET COMPOSER_NO_INTERACTION=1
- SET ANSICON=121x90 (121x90)
services:
- mysql
- iis

## Install PHP and composer, and run the appropriate composer command
install:
Expand Down Expand Up @@ -45,12 +41,40 @@ install:
- cd C:\projects\joomla-cms
- refreshenv
- composer install --no-progress --profile --ignore-platform-req=ext-sodium

hosts:
openldap: 127.0.0.1

services:
- mysql
- iis

before_test:
# Run openldap docker image
- ps: docker pull bitnami/openldap:latest
- ps: docker run --rm --name openldap --publish 1389:1389 --publish 1636:1636 -v ${pwd}\tests\Codeception\_data\certs:/certificates --env LDAP_ADMIN_USERNAME=admin --env LDAP_ADMIN_PASSWORD=adminpassword --env LDAP_USERS=customuser --env LDAP_PASSWORDS=custompassword --env LDAP_ENABLE_TLS=yes --env LDAP_TLS_CERT_FILE=/certificates/openldap.crt --env LDAP_TLS_KEY_FILE=/certificates/openldap.key --env LDAP_TLS_CA_FILE=/certificates/CA.crt --env BITNAMI_DEBUG=true --env LDAP_CONFIG_ADMIN_ENABLED=yes --env LDAP_CONFIG_ADMIN_USERNAME=admin --env LDAP_CONFIG_ADMIN_PASSWORD=configpassword -d bitnami/openldap:latest
# 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 test_joomla;"
# Wait till slapd has started
- ps: |
$Counter=0
$Found=$false
While ( ! $Found -and $Counter -lt 60 ) {
$Found = ( docker logs openldap 2>&1 | Select-String -Quiet "\*\* Starting slapd \*\*" )
Start-Sleep -Seconds 1
$Counter++
"$Counter Waiting for slapd"
}
if ( ! $Found ) {
Write-Error -Message "`nERROR: slapd not started (in time)!" -ErrorAction Stop
exit 1
}
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

on_failure:
- ps: docker logs openldap 2>&1
36 changes: 35 additions & 1 deletion .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,37 @@ name: default
clone:

steps:
- name: setup
image: joomlaprojects/docker-images:php7.4
volumes:
- name: certificates
path: /certificates
commands:
- cp -v tests/Codeception/_data/certs/* /certificates/

- name: openldap
image: bitnami/openldap:latest
detach: true
ports:
- 1389
- 1636
volumes:
- name: certificates
path: /certificates
environment:
LDAP_ADMIN_USERNAME: admin
LDAP_ADMIN_PASSWORD: adminpassword
LDAP_USERS: customuser
LDAP_PASSWORDS: custompassword
LDAP_ENABLE_TLS: yes
LDAP_TLS_CERT_FILE: /certificates/openldap.crt
LDAP_TLS_KEY_FILE: /certificates/openldap.key
LDAP_TLS_CA_FILE: /certificates/CA.crt
BITNAMI_DEBUG: true
LDAP_CONFIG_ADMIN_ENABLED: yes
LDAP_CONFIG_ADMIN_USERNAME: admin
LDAP_CONFIG_ADMIN_PASSWORD: configpassword

- name: composer
image: joomlaprojects/docker-images:php7.4
volumes:
Expand Down Expand Up @@ -361,6 +392,9 @@ volumes:
- name: npm-cache
host:
path: /tmp/npm-cache
- name: certificates
host:
path: /tmp/certificates

services:
- name: mysql
Expand Down Expand Up @@ -483,6 +517,6 @@ trigger:

---
kind: signature
hmac: 916fe89f8d920e8471b32aae02bfe192abf24cd035b5f1ea73452662c1c92895
hmac: 62722201dc57c6d193bed2a67860fe4cced46d38ebfdfe12a45a79a15a59e07e

...
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ insert_final_newline = true
indent_style = space
indent_size = 4

[*.{js,json,scss,css,vue}]
[*.{js,json,scss,css,yml,vue}]
indent_style = space
indent_size = 2
9 changes: 5 additions & 4 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,12 @@ If it is a PR, include what the issue is, what the PR is addressing, testing ins
Please be patient as not all items will be tested immediately (remember, all bug testing for the Joomla! CMS is done by volunteers) and be receptive to feedback about your code.

#### Branches
PRs should usually be made to the `4.1-dev` branch as this contains the most recent version of the code.
PRs should usually be made to the `4.2-dev` branch as this contains the most recent version of the code.
There are other branches available which serve specific purposes.

| Branch | Purpose |
| ------ | ------- |
| 3.10-dev | Branch for the Joomla 3.x series. The 3.10 series release will only include compatibility features for 4.x as well as bugfixes and security patches. |
| 4.1-dev | Branch for the current minor Joomla version. Commits to 3.10-dev will be applied to this branch as well. |
| 4.2-dev | Branch for the next minor Joomla version. New features go into this branch. Commits to 4.1-dev will be applied to this branch as well. |
| 3.10-dev | Branch for the Joomla 3.x series. The 3.10 series release will now only include security patches. |
| 4.2-dev | Branch for the current minor Joomla version.|
| 4.3-dev | Branch for the next minor Joomla version. New features go into this branch. Commits to 4.2-dev will be applied to this branch as well. |
| 5.0-dev | Branch for the next major Joomla version. |
142 changes: 72 additions & 70 deletions .github/workflows/create-translation-pull-request-v4.yml
Original file line number Diff line number Diff line change
@@ -1,75 +1,77 @@
name: Create translation pull request

on:
push:
branches: [ translation ]

workflow_dispatch:

schedule:
# Run daily at 7:26
- cron: '26 7 * * *'

name: Create translation pull request

on:
push:
branches: [ translation ]

workflow_dispatch:

schedule:
# Run daily at 7:26
- cron: '27 7 * * *'

permissions:
contents: read

jobs:
build:
jobs:
build:
permissions:
contents: write # for Git to git push
runs-on: ubuntu-latest
# Only run this action the translation-bot repository in the translation branch
if: ${{ github.repository == 'joomla-translation-bot/joomla-cms' && github.ref == 'refs/heads/translation' }}

steps:
- uses: actions/checkout@v2
# We need the full depth to create / update the pull request against the main repo
with:
fetch-depth: 0
- uses: actions/setup-node@v1
with:
node-version: 12

- name: Fetch latest cms changes
run: |
git config user.name Translation Bot
git config user.email release+translation-bot@joomla.org
git remote add upstream https://github.com/joomla/joomla-cms.git
git fetch upstream
git checkout --progress --force -B translation refs/remotes/origin/translation
git merge upstream/4.1-dev
- name: Fetch and extract translations
run: |
cd ..
wget -nv "https://github.com/joomla/core-translations/archive/refs/heads/main.zip"
unzip main.zip
- name: Syncing directories
# We use a simple copy paste syntax here if needed customization for different directories
run: |
cd ..
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_VERSION}/translations/core/${SYNC_PATH} joomla-cms/${SYNC_PATH}
- name: Update static error pages
run: |
npm ci --ignore-scripts && node build/build.js --build-pages
- name: Create commit
run: |
git config user.name Translation Bot
git config user.email release+translation-bot@joomla.org
git add .
git commit -m "Language update"
git push --force
- name: Create pull request
env:
GITHUB_TOKEN: ${{ secrets.API_TOKEN_GITHUB }}
run: |
gh pr list -R joomla/joomla-cms --state open --author joomla-translation-bot -S "Translation Update" | grep -v "No pull" || \
gh pr create --title "Translation Update" --body "Automatically created pull request based on core-translation repository changes" -R joomla/joomla-cms --base 4.1-dev
runs-on: ubuntu-latest
# Only run this action the translation-bot repository in the translation branch
if: ${{ github.repository == 'joomla-translation-bot/joomla-cms' && github.ref == 'refs/heads/translation' }}

steps:
- uses: actions/checkout@v2
# We need the full depth to create / update the pull request against the main repo
with:
fetch-depth: 0
- uses: actions/setup-node@v1
with:
node-version: 12

- name: Fetch latest cms changes
run: |
git config user.name Translation Bot
git config user.email release+translation-bot@joomla.org
git remote add upstream https://github.com/joomla/joomla-cms.git
git fetch upstream
git checkout --progress --force -B translation refs/remotes/origin/translation
git merge upstream/4.2-dev
- name: Fetch and extract translations
run: |
cd ..
wget -nv "https://github.com/joomla/core-translations/archive/refs/heads/main.zip"
unzip main.zip
- name: Syncing directories
# We use a simple copy paste syntax here if needed customization for different directories
run: |
cd ..
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_VERSION}/translations/core/${SYNC_PATH} joomla-cms/${SYNC_PATH}
- name: Update static error pages
run: |
npm ci --ignore-scripts && node build/build.js --build-pages
- name: Create commit
continue-on-error: true
run: |
git config user.name Translation Bot
git config user.email release+translation-bot@joomla.org
git add .
git commit -m "Language update"
git push --force
- name: Create pull request
if: ${{ success() }}
env:
GITHUB_TOKEN: ${{ secrets.API_TOKEN_GITHUB }}
run: |
gh pr list -R joomla/joomla-cms --state open --author joomla-translation-bot -S "Translation Update" | grep -v "No pull" || \
gh pr create --title "Translation Update" --body "Automatically created pull request based on core-translation repository changes" -R joomla/joomla-cms --base 4.2-dev
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -107,3 +107,6 @@ RoboFile.ini
!/tests/cypress/screenshots/.gitkeep
/tests/cypress/videos
!/tests/cypress/videos/.gitkeep

# WebAuthn FIDO metadata cache
/plugins/system/webauthn/fido.jwt
3 changes: 3 additions & 0 deletions administrator/components/com_admin/script.php
Original file line number Diff line number Diff line change
Expand Up @@ -6440,6 +6440,7 @@ public function deleteUnexistingFiles($dryRun = false, $suppressOutput = false)
'/plugins/task/checkfiles/checkfiles.php',
'/plugins/task/demotasks/demotasks.php',
// From 4.2.0-rc1 to 4.2.0
'/build/media_source/com_menus/css/admin-item-edit_modules.css',
'/administrator/language/en-GB/plg_fields_menuitem.ini',
'/administrator/language/en-GB/plg_fields_menuitem.sys.ini',
'/plugins/fields/menuitem/menuitem.php',
Expand All @@ -6450,6 +6451,8 @@ public function deleteUnexistingFiles($dryRun = false, $suppressOutput = false)
'/media/vendor/hotkeys.js/js/hotkeys.min.js',
'/media/vendor/hotkeys.js/js/hotkeys.min.js.gz',
'/media/vendor/hotkeys.js/LICENSE',
// From 4.2.1 to 4.2.2
'/administrator/cache/fido.jwt',
);

$folders = array(
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
-- Remove the record of any template overrides where the template has already been uninstalled
DELETE FROM `#__template_overrides` WHERE `template` NOT IN (SELECT `name` FROM `#__extensions` WHERE `type`='template');
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
-- Remove the record of any template overrides where the template has already been uninstalled
DELETE FROM "#__template_overrides" WHERE "template" NOT IN (SELECT "name" FROM "#__extensions" WHERE "type"='template');
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@

use Exception;
use Joomla\CMS\Access\Exception\NotAllowed;
use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;
use Joomla\CMS\MVC\View\HtmlView as BaseHtmlView;
use Joomla\CMS\Router\Route;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
use Joomla\CMS\Language\Text;
use Joomla\CMS\MVC\Controller\AdminController;
use Joomla\CMS\MVC\Factory\MVCFactoryInterface;
use Joomla\CMS\Response\JsonResponse;
use Joomla\Input\Input;
use Joomla\Utilities\ArrayHelper;

Expand Down Expand Up @@ -112,4 +113,28 @@ public function sticky_publish()

$this->setRedirect('index.php?option=com_banners&view=banners');
}

/**
* Method to get the number of published banners for quickicons
*
* @return string The JSON-encoded amount of published banners
*
* @since __DEPLOY_VERSION__
*/
public function getQuickiconContent()
{
$model = $this->getModel('banners');

$model->setState('filter.published', 1);

$amount = (int) $model->getTotal();

$result = [];

$result['amount'] = $amount;
$result['sronly'] = Text::plural('COM_BANNERS_N_QUICKICON_SRONLY', $amount);
$result['name'] = Text::plural('COM_BANNERS_N_QUICKICON', $amount);

echo new JsonResponse($result);
}
}
7 changes: 4 additions & 3 deletions administrator/components/com_banners/tmpl/banners/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -177,11 +177,12 @@
<?php echo $this->pagination->getListFooter(); ?>

<?php // Load the batch processing form. ?>
<?php if (
$user->authorise('core.create', 'com_banners')
<?php
if (
$user->authorise('core.create', 'com_banners')
&& $user->authorise('core.edit', 'com_banners')
&& $user->authorise('core.edit.state', 'com_banners')
) : ?>
) : ?>
<?php echo HTMLHelper::_(
'bootstrap.renderModal',
'collapseModal',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -279,11 +279,12 @@
<?php echo $this->pagination->getListFooter(); ?>

<?php // Load the batch processing form. ?>
<?php if (
$user->authorise('core.create', $extension)
<?php
if (
$user->authorise('core.create', $extension)
&& $user->authorise('core.edit', $extension)
&& $user->authorise('core.edit.state', $extension)
) : ?>
) : ?>
<?php echo HTMLHelper::_(
'bootstrap.renderModal',
'collapseModal',
Expand Down

0 comments on commit 0e08760

Please sign in to comment.