Skip to content

Commit

Permalink
Merge branch '4.3-dev' of https://github.com/joomla/joomla-cms into 4…
Browse files Browse the repository at this point in the history
….2-phpcs-phpversion

# Conflicts:
#	.drone.yml
  • Loading branch information
Hackwar committed Sep 20, 2022
2 parents ee4710b + bf18874 commit e3f3a73
Show file tree
Hide file tree
Showing 62 changed files with 1,293 additions and 101 deletions.
32 changes: 28 additions & 4 deletions .appveyor.yml
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
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: d6e698c8f35974fdbf1db57f196a1133009eb6522e0ff3d7099fe9d47f7835de
hmac: c850e892dfbe03549fe506a436dcafe7880cff3c78e9a3130582abbe7c13c3f9

...
4 changes: 3 additions & 1 deletion .github/workflows/create-translation-pull-request-v4.yml
Expand Up @@ -8,7 +8,7 @@ on:

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

permissions:
contents: read
Expand Down Expand Up @@ -60,6 +60,7 @@ jobs:
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
Expand All @@ -68,6 +69,7 @@ jobs:
git push --force
- name: Create pull request
if: ${{ success() }}
env:
GITHUB_TOKEN: ${{ secrets.API_TOKEN_GITHUB }}
run: |
Expand Down
1 change: 1 addition & 0 deletions administrator/components/com_admin/script.php
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 Down
@@ -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');
@@ -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');
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);
}
}
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 @@ -121,4 +122,28 @@ public function getModel($name = 'Contact', $prefix = 'Administrator', $config =
{
return parent::getModel($name, $prefix, $config);
}

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

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

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

$result = [];

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

echo new JsonResponse($result);
}
}
Expand Up @@ -11,6 +11,7 @@
namespace Joomla\Component\Content\Administrator\Controller;

use Joomla\CMS\Language\Text;
use Joomla\CMS\Response\JsonResponse;

// phpcs:disable PSR1.Files.SideEffects
\defined('_JEXEC') or die;
Expand Down Expand Up @@ -98,4 +99,29 @@ public function getModel($name = 'Feature', $prefix = 'Administrator', $config =
{
return parent::getModel($name, $prefix, $config);
}

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

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

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

$result = [];

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

echo new JsonResponse($result);
}
}
Expand Up @@ -10,7 +10,9 @@

namespace Joomla\Component\Languages\Administrator\Controller;

use Joomla\CMS\Language\Text;
use Joomla\CMS\MVC\Controller\AdminController;
use Joomla\CMS\Response\JsonResponse;

// phpcs:disable PSR1.Files.SideEffects
\defined('_JEXEC') or die;
Expand Down Expand Up @@ -38,4 +40,28 @@ public function getModel($name = 'Language', $prefix = 'Administrator', $config
{
return parent::getModel($name, $prefix, $config);
}

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

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

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

$result = [];

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

echo new JsonResponse($result);
}
}
Expand Up @@ -22,8 +22,7 @@

/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */
$wa = $this->document->getWebAssetManager();
$wa->useStyle('com_menus.admin-item-edit-modules')
->useScript('com_menus.admin-item-edit-modules');
$wa->useScript('com_menus.admin-item-edit-modules');

// Set up the bootstrap modal that will be used for all module editors
echo HTMLHelper::_(
Expand Down
9 changes: 2 additions & 7 deletions administrator/components/com_menus/tmpl/items/modal.php
Expand Up @@ -87,7 +87,6 @@
</thead>
<tbody>
<?php foreach ($this->items as $i => $item) : ?>
<?php $uselessMenuItem = in_array($item->type, array('separator', 'heading', 'alias', 'url', 'container')); ?>
<?php if ($item->language && $multilang) {
if ($item->language !== '*') {
$language = $item->language;
Expand All @@ -105,12 +104,8 @@
<th scope="row">
<?php $prefix = LayoutHelper::render('joomla.html.treeprefix', array('level' => $item->level)); ?>
<?php echo $prefix; ?>
<?php if (!$uselessMenuItem) : ?>
<a class="select-link" href="javascript:void(0)" data-function="<?php echo $this->escape($function); ?>" data-id="<?php echo $item->id; ?>" data-title="<?php echo $this->escape($item->title); ?>" data-uri="<?php echo 'index.php?Itemid=' . $item->id; ?>" data-language="<?php echo $this->escape($language); ?>">
<?php echo $this->escape($item->title); ?></a>
<?php else : ?>
<?php echo $this->escape($item->title); ?>
<?php endif; ?>
<a class="select-link" href="javascript:void(0)" data-function="<?php echo $this->escape($function); ?>" data-id="<?php echo $item->id; ?>" data-title="<?php echo $this->escape($item->title); ?>" data-uri="<?php echo 'index.php?Itemid=' . $item->id; ?>" data-language="<?php echo $this->escape($language); ?>">
<?php echo $this->escape($item->title); ?></a>
<?php echo HTMLHelper::_('menus.visibility', $item->params); ?>
<div>
<?php echo $prefix; ?>
Expand Down
Expand Up @@ -10,7 +10,9 @@

namespace Joomla\Component\Newsfeeds\Administrator\Controller;

use Joomla\CMS\Language\Text;
use Joomla\CMS\MVC\Controller\AdminController;
use Joomla\CMS\Response\JsonResponse;

// phpcs:disable PSR1.Files.SideEffects
\defined('_JEXEC') or die;
Expand Down Expand Up @@ -38,4 +40,28 @@ public function getModel($name = 'Newsfeed', $prefix = 'Administrator', $config
{
return parent::getModel($name, $prefix, $config);
}

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

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

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

$result = [];

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

echo new JsonResponse($result);
}
}

0 comments on commit e3f3a73

Please sign in to comment.