Skip to content

Commit

Permalink
Merge branch '5.1-dev' into fix-39851
Browse files Browse the repository at this point in the history
  • Loading branch information
Razzo1987 committed Dec 28, 2023
2 parents b8995aa + eb24234 commit 1020b38
Show file tree
Hide file tree
Showing 2,280 changed files with 50,289 additions and 31,368 deletions.
4 changes: 2 additions & 2 deletions .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,16 +48,16 @@ hosts:
openldap: 127.0.0.1

services:
- mysql
- iis

before_test:
# Run openldap docker image
- ps: docker pull bitnami/openldap:2.6.3
- ps: docker run --rm --name openldap --publish 1389:1389 --publish 1636:1636 -v ${pwd}\tests\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:2.6.3
# Database setup for MySQL via PowerShell tools
- ps: Start-Service MySQL80
- >
"C:\Program Files\MySQL\MySQL Server 5.7\bin\mysql" -u root -p"Password12!" -e "CREATE DATABASE IF NOT EXISTS test_joomla;"
"C:\Program Files\MySQL\MySQL Server 8.0\bin\mysql" -u root -p"Password12!" -e "CREATE DATABASE IF NOT EXISTS test_joomla;"
# Wait till slapd has started
- ps: |
$Counter=0
Expand Down
62 changes: 36 additions & 26 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ steps:
- ./libraries/vendor/bin/phan

- name: npm
image: node:16-bullseye-slim
image: node:20-bullseye-slim
depends_on: [ phpcs ]
volumes:
- name: npm-cache
Expand Down Expand Up @@ -286,29 +286,39 @@ steps:
- name: packager
image: joomlaprojects/docker-images:packager
environment:
FTP_USERNAME:
from_secret: ftpusername
FTP_PASSWORD:
from_secret: ftppassword
FTP_HOSTNAME: ci.joomla.org
FTP_PORT: "21"
FTP_DEST_DIR: /artifacts
FTP_VERIFY: "false"
FTP_SECURE: "true"
HTTP_ROOT: "https://ci.joomla.org/artifacts"
HTTP_ROOT: "https://artifacts.joomla.org/drone"
DRONE_PULL_REQUEST: DRONE_PULL_REQUEST
DRONE_COMMIT: DRONE_COMMIT
commands:
- /bin/drone_prepare_package.sh

- name: upload
image: joomlaprojects/docker-images:packager
environment:
package_key:
from_secret: package_key
package_user:
from_secret: package_user
package_host:
from_secret: package_host
package_root:
from_secret: package_root
GITHUB_TOKEN:
from_secret: github_token
commands:
- if [ $DRONE_REPO_NAME != 'joomla-cms' ]; then echo "The packager only runs on the joomla/joomla-cms repo"; exit 0; fi
- /bin/drone_build.sh
volumes:
- name: reference
path: /reference
when:
repo:
- joomla/joomla-cms
- mkdir -p ~/.ssh
- eval $(ssh-agent -s)
- echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config
- echo "$package_key" > ~/.ssh/id_rsa
- chmod 600 ~/.ssh/id_rsa
- ssh-add
- rclone config create package sftp host $package_host user $package_user port 22
- rclone copy ./upload/ package:$package_root/$DRONE_REPO/$DRONE_BRANCH/$DRONE_PULL_REQUEST/downloads/$DRONE_BUILD_NUMBER
- /bin/add_github_status.sh "Download" "Prebuilt packages are available for download." "https://artifacts.joomla.org/drone/${DRONE_REPO}/${DRONE_BRANCH}/${DRONE_PULL_REQUEST}/downloads/${DRONE_BUILD_NUMBER}"

trigger:
repo:
- joomla/joomla-cms

---
kind: pipeline
Expand All @@ -335,8 +345,8 @@ steps:
from_secret: nightly_user
nightly_host:
from_secret: nightly_host
RINGCENTRAL_WEBHOOK:
from_secret: notification_url
MATTERMOST_NIGHTLY_HOOK:
from_secret: mattermost_nightly_hook
commands:
- export MINORVERSION=${DRONE_BRANCH%-*}
- mkdir -p ~/.ssh
Expand All @@ -349,15 +359,15 @@ steps:
- rclone delete nightly:/home/devj/public_html/nightlies/ --include "Joomla_$MINORVERSION.*"
- rclone delete nightly:/home/devj/public_html/cache/com_content/
- rclone copy ./transfer/ nightly:/home/devj/public_html/nightlies/
- /bin/notify
- curl -i -X POST -H 'Content-Type:application/json' -d '{"text":"Nightly Build for [Joomla 5.1](https://developer.joomla.org/nightly-builds.html) successfully built."}' $MATTERMOST_NIGHTLY_HOOK

- name: buildfailure
image: joomlaprojects/docker-images:packager
environment:
RINGCENTRAL_WEBHOOK:
from_secret: notification_url
MATTERMOST_NIGHTLY_HOOK:
from_secret: mattermost_nightly_hook
commands:
- /bin/notify
- curl -i -X POST -H 'Content-Type:application/json' -d '{"text":"Nightly Build for [Joomla 5.1](https://developer.joomla.org/nightly-builds.html) FAILED to built."}' $MATTERMOST_NIGHTLY_HOOK
when:
status:
- failure
Expand All @@ -372,6 +382,6 @@ trigger:

---
kind: signature
hmac: 6b06b1c7f407650fe98f0851dc865911f399422116fa4f250a52d01a556397ed
hmac: 5814cadc441b90eec51da0aa32cd29ff1014c4d759841cc70063b5e9245d2b08

...
16 changes: 4 additions & 12 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
# Custom Fields
administrator/components/com_fields/* @laoneo
components/com_fields/* @laoneo
plugins/content/fields/* @laoneo
plugins/editors-xtd/fields/* @laoneo
plugins/fields/* @laoneo
plugins/systems/fields/* @laoneo

# Smart Search
administrator/components/com_finder/* @hackwar
components/com_finder/* @hackwar
Expand All @@ -14,10 +6,10 @@ plugins/content/finder/* @hackwar
plugins/finder/* @hackwar

# Release Tools
build.xml @wilsonge
build/build.php @rdeutz @wilsonge
build/bump.php @rdeutz @wilsonge
build/deleted_file_check.php @rdeutz @wilsonge
build.xml @fancyFranci
build/build.php @rdeutz
build/bump.php @rdeutz
build/deleted_file_check.php @rdeutz

# Core/Extension Install/Update Tools
administrator/components/com_joomlaupdate/* @rdeutz @zero-24
Expand Down
8 changes: 4 additions & 4 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +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.2-dev` branch as this contains the most recent version of the code.
PRs should usually be made to the `4.3-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 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. |
| 4.3-dev | Branch for the current minor Joomla version.|
| 4.4-dev | Branch for the next minor Joomla version. Commits to 4.3-dev will be applied to this branch as well. |
| 5.0-dev | Branch for the next major Joomla version. New features go into this branch. |
4 changes: 2 additions & 2 deletions .phan/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
* default configuration. Command line arguments will be applied
* after this file is read.
*
* @see https://github.com/phan/phan/wiki/Phan-Config-Settings for all configurable options
* @see https://github.com/phan/phan/tree/v4/src/Phan/Config.php
* @link https://github.com/phan/phan/wiki/Phan-Config-Settings for all configurable options
* @link https://github.com/phan/phan/tree/v4/src/Phan/Config.php
*
* A Note About Paths
* ==================
Expand Down
10 changes: 8 additions & 2 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
/**
* This is the configuration file for php-cs-fixer
*
* @see https://github.com/FriendsOfPHP/PHP-CS-Fixer
* @see https://mlocati.github.io/php-cs-fixer-configurator/#version:3.0
* @link https://github.com/FriendsOfPHP/PHP-CS-Fixer
* @link https://mlocati.github.io/php-cs-fixer-configurator/#version:3.0
*
*
* If you would like to run the automated clean up, then open a command line and type one of the commands below
Expand Down Expand Up @@ -82,6 +82,12 @@
'no_unused_imports' => true,
// Classes from the global namespace should not be imported
'global_namespace_import' => ['import_classes' => false, 'import_constants' => false, 'import_functions' => false],
// Alpha order imports
'ordered_imports' => ['imports_order' => ['class', 'function', 'const'], 'sort_algorithm' => 'alpha'],
// There should not be useless else cases
'no_useless_else' => true,
// Native function invocation
'native_function_invocation' => ['include' => ['@compiler_optimized']],
]
)
->setFinder($finder);
Expand Down
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
Joomla! CMS™
====================

The Joomla! 5.0 branch is under heavy development and not all links in this document are available yet
The Joomla! 5.1 branch is under heavy development and not all links in this document are available yet
------------------------------------------------------------------------------------------------------

Build Status
---------------------
| Drone-CI | AppVeyor | PHP | Node | npm |
|------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------| ------------- | ------------- |
| [![Build Status](https://ci.joomla.org/api/badges/joomla/joomla-cms/status.svg?branch=5.0-dev)](https://ci.joomla.org/joomla/joomla-cms) | [![Build status](https://ci.appveyor.com/api/projects/status/ru6sxal8jmfckvjc/branch/5.0-dev?svg=true)](https://ci.appveyor.com/project/release-joomla/joomla-cms) | [![PHP](https://img.shields.io/badge/PHP-V8.1.0-green)](https://www.php.net/) | [![node-lts](https://img.shields.io/badge/Node-V16.0-green)](https://nodejs.org/en/) | [![npm](https://img.shields.io/badge/npm-v8.6.0-green)](https://nodejs.org/en/) |
| Drone-CI | AppVeyor | PHP | Node | npm |
|------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------|--------------------------------------------------------------------------------------|---------------------------------------------------------------------------------|
| [![Build Status](https://ci.joomla.org/api/badges/joomla/joomla-cms/status.svg?branch=5.1-dev)](https://ci.joomla.org/joomla/joomla-cms) | [![Build status](https://ci.appveyor.com/api/projects/status/ru6sxal8jmfckvjc/branch/5.1-dev?svg=true)](https://ci.appveyor.com/project/release-joomla/joomla-cms) | [![PHP](https://img.shields.io/badge/PHP-V8.1.0-green)](https://www.php.net/) | [![node-lts](https://img.shields.io/badge/Node-V18.0-green)](https://nodejs.org/en/) | [![npm](https://img.shields.io/badge/npm-v9.6.7-green)](https://nodejs.org/en/) |

Overview
---------------------
* This is the source of Joomla! 5.x.
* Joomla's [Official website](https://www.joomla.org).
* Joomla! 5.0 [version history](https://docs.joomla.org/Special:MyLanguage/Joomla_5.0_version_history).
* Detailed changes are in the [changelog](https://github.com/joomla/joomla-cms/commits/5.0-dev).
* Joomla! 5.1 [version history](https://docs.joomla.org/Special:MyLanguage/Joomla_5.1_version_history).
* Detailed changes are in the [changelog](https://github.com/joomla/joomla-cms/commits/5.1-dev).

What is Joomla?
---------------------
Expand Down Expand Up @@ -48,9 +48,9 @@ git clone https://github.com/joomla/joomla-cms.git
```bash
cd joomla-cms
```
- Go to the 5.0-dev branch:
- Go to the 5.1-dev branch:
```bash
git checkout 5.0-dev
git checkout 5.1-dev
```
- Install all the needed composer packages:
```bash
Expand Down
6 changes: 3 additions & 3 deletions README.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
Joomla! CMS™

The Joomla! 5.0 branch is under heavy development and not all links in this document are available yet
The Joomla! 5.1 branch is under heavy development and not all links in this document are available yet
------------------------------------------------------------------------------------------------------

1- Overview
* This is a Joomla! 5.x installation/upgrade package.
* Joomla! Official site: https://www.joomla.org
* Joomla! 5.0 version history - https://docs.joomla.org/Special:MyLanguage/Joomla_5.0_version_history
* Detailed changes in the Changelog: https://github.com/joomla/joomla-cms/commits/5.0-dev
* Joomla! 5.1 version history - https://docs.joomla.org/Special:MyLanguage/Joomla_5.1_version_history
* Detailed changes in the Changelog: https://github.com/joomla/joomla-cms/commits/5.1-dev

2- What is Joomla?
* Joomla! is a Content Management System (CMS) which enables you to build websites and powerful online applications.
Expand Down
2 changes: 1 addition & 1 deletion administrator/components/com_actionlogs/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
label="COM_ACTIONLOGS_LOG_EXTENSIONS_LABEL"
multiple="true"
layout="joomla.form.field.list-fancy-select"
default="com_banners,com_cache,com_categories,com_checkin,com_config,com_contact,com_content,com_installer,com_media,com_menus,com_messages,com_modules,com_newsfeeds,com_plugins,com_redirect,com_scheduler,com_tags,com_templates,com_users"
default="com_banners,com_cache,com_categories,com_checkin,com_config,com_contact,com_content,com_fields,com_installer,com_media,com_menus,com_messages,com_modules,com_newsfeeds,com_plugins,com_redirect,com_scheduler,com_tags,com_templates,com_users"
/>
<field
name="loggable_api"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/

defined('_JEXEC') or die;
\defined('_JEXEC') or die;

use Joomla\CMS\Dispatcher\ComponentDispatcherFactoryInterface;
use Joomla\CMS\Extension\ComponentInterface;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
use Joomla\CMS\Application\CMSApplication;
use Joomla\CMS\Component\ComponentHelper;
use Joomla\CMS\Date\Date;
use Joomla\CMS\Event\ActionLog\AfterLogExportEvent;
use Joomla\CMS\Input\Input;
use Joomla\CMS\Language\Text;
use Joomla\CMS\MVC\Controller\AdminController;
Expand Down Expand Up @@ -113,7 +114,7 @@ public function exportLogs()
}

fclose($output);
$this->app->triggerEvent('onAfterLogExport', []);
$this->getDispatcher()->dispatch('onAfterLogExport', new AfterLogExportEvent('onAfterLogExport'));
$this->app->close();
} else {
$this->setMessage(Text::_('COM_ACTIONLOGS_NO_LOGS_TO_EXPORT'));
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
<?php

/**
* @package Joomla.Administrator
* @subpackage com_actionlogs
*
* @copyright (C) 2022 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/

namespace Joomla\Component\Actionlogs\Administrator\Field;

use Joomla\CMS\Application\ApplicationHelper;
use Joomla\CMS\Component\ComponentHelper;
use Joomla\CMS\Factory;
use Joomla\CMS\Form\Field\ListField;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
use Joomla\Component\Actionlogs\Administrator\Helper\ActionlogsHelper;
use Joomla\Database\ParameterType;

/**
* Field to load a list of all users that have logged actions
*
* @since 5.1.0
*/
class UserlogtypeField extends ListField
{
/**
* The form field type.
*
* @var string
* @since 5.1.0
*/
protected $type = 'UserLogType';

/**
* Method to get the field options.
*
* @return array The field option objects.
*
* @since 5.1.0
*/
public function getOptions()
{
$db = $this->getDatabase();
$user = Factory::getApplication()->getIdentity();
$query = $db->getQuery(true)
->select($db->quoteName('extensions'))
->from($db->quoteName('#__action_logs_users'))
->where($db->quoteName('user_id') . ' = :userid')
->bind(':userid', $user->id, ParameterType::INTEGER);

$extensions = $db->setQuery($query)->loadColumn();
$userExt = [];
$params = ComponentHelper::getParams('com_actionlogs');
$globalExt = $params->get('loggable_extensions', []);

if (!empty($extensions)) {
$userExt = substr($extensions[0], 2);
$userExt = substr($userExt, 0, -2);
$userExt = explode('","', $userExt);
}

$common = array_merge($globalExt, array_intersect($globalExt, $userExt));
$options = [];

foreach ($common as $extension) {
ActionlogsHelper::loadTranslationFiles($extension);
$extensionName = Text::_($extension);
$options[ApplicationHelper::stringURLSafe($extensionName) . '_' . $extension] = HTMLHelper::_('select.option', $extension, $extensionName);
}

ksort($options);

return array_merge(parent::getOptions(), array_values($options));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@

use Joomla\CMS\Date\Date;
use Joomla\CMS\Factory;
use Joomla\CMS\Filesystem\Path;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Object\CMSObject;
use Joomla\CMS\Router\Route;
use Joomla\Filesystem\Path;
use Joomla\String\StringHelper;

// phpcs:disable PSR1.Files.SideEffects
Expand Down Expand Up @@ -56,7 +56,7 @@ public static function getCsvData($data): \Generator
sprintf(
'%s() requires an array or object implementing the Traversable interface, a %s was given.',
__METHOD__,
\gettype($data) === 'object' ? \get_class($data) : \gettype($data)
\is_object($data) ? \get_class($data) : \gettype($data)
)
);
}
Expand Down

0 comments on commit 1020b38

Please sign in to comment.