Skip to content

Commit

Permalink
Merge branch '4.4-dev' into 4.4-backendmenu-additional-features
Browse files Browse the repository at this point in the history
  • Loading branch information
Hackwar authored Jul 23, 2024
2 parents 2794e30 + 1221ba2 commit ee585f5
Show file tree
Hide file tree
Showing 209 changed files with 4,212 additions and 563 deletions.
38 changes: 23 additions & 15 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ steps:
environment:
CYPRESS_VERIFY_TIMEOUT: 100000
commands:
- mv cypress.config.dist.js cypress.config.js
- mv cypress.config.dist.mjs cypress.config.mjs
- npx cypress install
- npx cypress verify

Expand Down Expand Up @@ -311,21 +311,29 @@ steps:
environment:
WEB_SERVER:
from_secret: webserver
FTP_SERVER:
from_secret: ftpserver
FTP_USERNAME:
from_secret: ftpusername
FTP_PASSWORD:
from_secret: ftppassword
FTP_KEY:
from_secret: ftp_key
FTP_USER:
from_secret: ftp_user
FTP_HOST:
from_secret: ftp_host
ARTIFACTS_ROOT:
from_secret: artifacts_root
GITHUB_TOKEN:
from_secret: github_token
commands:
- export PLUGIN_DEST_DIR=/artifacts/$DRONE_REPO/$DRONE_BRANCH/$DRONE_PULL_REQUEST/system-tests/$DRONE_BUILD_NUMBER
- echo https://$WEB_SERVER$PLUGIN_DEST_DIR
- rclone config create artifacts ftp host $FTP_SERVER user $FTP_USERNAME port 21 pass $FTP_PASSWORD
- rclone mkdir artifacts:$PLUGIN_DEST_DIR
- rclone copy tests/System/output/ artifacts:$PLUGIN_DEST_DIR
- 'curl -X POST "https://api.github.com/repos/$DRONE_REPO/statuses/$DRONE_COMMIT" -H "Content-Type: application/json" -H "Authorization: token $GITHUB_TOKEN" -d "{\"state\":\"failure\", \"context\": \"Artifacts from Failure\", \"description\": \"You can find artifacts from the failure of the build here:\", \"target_url\": \"https://$WEB_SERVER$PLUGIN_DEST_DIR\"}" > /dev/null'
- export PLUGIN_DEST_DIR=$DRONE_REPO/$DRONE_BRANCH/$DRONE_PULL_REQUEST/system-tests/$DRONE_BUILD_NUMBER
- echo https://$WEB_SERVER/drone/$PLUGIN_DEST_DIR
- mkdir -p ~/.ssh
- eval $(ssh-agent -s)
- echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config
- echo "$FTP_KEY" > ~/.ssh/id_rsa
- chmod 600 ~/.ssh/id_rsa
- ssh-add
- rclone config create artifacts sftp host $FTP_HOST user $FTP_USER port 22
- rclone mkdir artifacts:$ARTIFACTS_ROOT/$DRONE_REPO/$DRONE_BRANCH/$DRONE_PULL_REQUEST/system-tests/$DRONE_BUILD_NUMBER
- rclone copy tests/System/output/ artifacts:$ARTIFACTS_ROOT/$DRONE_REPO/$DRONE_BRANCH/$DRONE_PULL_REQUEST/system-tests/$DRONE_BUILD_NUMBER
- 'curl -X POST "https://api.github.com/repos/$DRONE_REPO/statuses/$DRONE_COMMIT" -H "Content-Type: application/json" -H "Authorization: token $GITHUB_TOKEN" -d "{\"state\":\"failure\", \"context\": \"Artifacts from Failure\", \"description\": \"You can find artifacts from the failure of the build here:\", \"target_url\": \"https://$WEB_SERVER/drone/$PLUGIN_DEST_DIR\"}" > /dev/null'
when:
status:
- failure
Expand Down Expand Up @@ -354,7 +362,7 @@ services:
MYSQL_DATABASE: test_joomla

- name: mysql8
image: mysql:8
image: mysql:8.0
command: ["--default-authentication-plugin=mysql_native_password"]
environment:
MYSQL_USER: joomla_ut
Expand Down Expand Up @@ -496,6 +504,6 @@ trigger:

---
kind: signature
hmac: ca3d5f3a6e39270f147f8f02ca4bc4cca7050f7ab2bcaf0258426e0089cfef5b
hmac: ccc71c7a0c6643aef1000b49a0125d4a9bf2bacedc3875c9106b31449e7f50f8

...
9 changes: 3 additions & 6 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ build/bump.php @rdeutz
build/deleted_file_check.php @rdeutz

# Core/Extension Install/Update Tools
administrator/components/com_joomlaupdate/* @rdeutz @zero-24
libraries/src/Installer/* @rdeutz @zero-24
libraries/src/Updater/* @rdeutz @zero-24
administrator/components/com_joomlaupdate/* @rdeutz
libraries/src/Installer/* @rdeutz
libraries/src/Updater/* @rdeutz

# Automated Testing
tests/* @hackwar @fancyFranci
Expand All @@ -24,9 +24,6 @@ tests/Unit/* @rdeutz @fancyFranci
phpunit.xml.dist @rdeutz @hackwar @fancyFranci
phpunit-pgsql.xml.dist @rdeutz @hackwar @fancyFranci

# HttpHeaders Plugin
plugins/system/httpheaders/* @zero-24

# Workflow
administrator/components/com_workflow/* @bembelimen @hleithner
administrator/language/en-GB/com_workflow.ini @bembelimen @hleithner
Expand Down
17 changes: 10 additions & 7 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,22 @@ You are welcome to submit a contribution for review and possible inclusion in th
2) Follow the [Joomla! Coding Standards](https://developer.joomla.org/coding-standards.html).

3) When filing an issue or opening a PR, please include a clear title and description. The title should be a short summary of an issue and, if possible, should include a reference to an open issue. For example, `Invalid Query in com_admin (Ref #1234)` would be sufficient. All issues and PRs should include a description with as much detail as possible.
If it is a PR, include what the issue is, what the PR is addressing, testing instructions and environmental information (PHP version, database driver and version, and other data you can retrieve from your site's system information view) in case the issue is specific to certain environments. If additional information is needed, please be prepared to provide it as our community members review your submission.
If it is a PR, include what the issue is, what the PR is addressing, testing instructions and environmental information (PHP version, database driver and version, and other data you can retrieve from your site's system information view) in case the issue is specific to certain environments. If additional information is needed, please be prepared to provide it as our community members review your submission.

4) Report security issues to the Joomla! Security Strike Team (JSST) at security@joomla.org or use the [JSST contact form](https://developer.joomla.org/contact-security-team.html). Please do not use the public tracker for security issues.

5) If you have a feature request, then please open a discussion to define the feature request and discuss possible solutions. Discussions can be converted into issues when the request is defined sufficiently that a developer can start coding the feature. In this process you will get feedback from the maintainers, if the feature is something for the Joomla core distribution or not.

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.3-dev` branch as this contains the most recent version of the code.
There are other branches available which serve specific purposes.
While 4.4 is in maintenance mode, ie we are still fixing bugs, PRs should be made to the `4.4-dev` branch. Merged bugfixes will be upmerged into the current 5.x branch. If a bug is only in the 5.x series the PR should be made to the current 5.x branch (currently 5.1).


| Branch | Purpose |
| ------ | ------- |
| 3.10-dev | Branch for the Joomla 3.x series. The 3.10 series release will now only include security patches. |
| 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.4-dev | Branch for the current 4.x Joomla version. Currently in maintenance mode |
| 5.1-dev | Branch for the current 5.x Joomla version. Bugfix only for 5.x go into this branch. |
| 5.2-dev | Branch for the next minor 5.x Joomla version. New features go into this branch. |
| 6.0-dev | Branch for the next major Joomla version. New features that include a b/c break have to go into this branch. |

2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ RoboFile.ini
!/tests/System/output/screenshots/.gitkeep
/tests/System/output/videos
!/tests/System/output/videos/.gitkeep
cypress.config.js
cypress.config.mjs

# WebAuthn FIDO metadata cache
/plugins/system/webauthn/fido.jwt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
// phpcs:enable PSR1.Files.SideEffects

/**
* Plugins display controller.
* Actionlogs display controller.
*
* @since 4.0.0
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,10 +177,10 @@ public static function getLogContentTypeParams($context)
*/
public static function getHumanReadableLogMessage($log, $generateLinks = true)
{
static::loadActionLogPluginsLanguage();
static $links = [];

$message = Text::_($log->message_language_key);
$messageData = json_decode($log->message, true);
$message = Text::_($log->message_language_key);
$messageData = json_decode($log->message, true);

// Special handling for translation extension name
if (isset($messageData['extension_name'])) {
Expand Down
30 changes: 30 additions & 0 deletions administrator/components/com_admin/postinstall/htaccessbrotli.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?php

/**
* @package Joomla.Administrator
* @subpackage com_admin
*
* @copyright (C) 2024 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*
* This file contains post-installation message handling for notifying users of a change
* in the default .htaccess file regarding setting the Content-Encoding header.
*/

// phpcs:disable PSR1.Files.SideEffects
\defined('_JEXEC') or die;
// phpcs:enable PSR1.Files.SideEffects

/**
* Notifies users of a change in the default .htaccess file regarding setting for brotli to prevent double compression
*
* This check returns true regardless of condition.
*
* @return boolean
*
* @since 4.4.4
*/
function admin_postinstall_htaccessbrotli_condition()
{
return true;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
--
-- Add post-installation message about setting the Content-Encoding header in .htaccess
--
INSERT IGNORE INTO `#__postinstall_messages` (`extension_id`, `title_key`, `description_key`, `action_key`, `language_extension`, `language_client_id`, `type`, `action_file`, `action`, `condition_file`, `condition_method`, `version_introduced`, `enabled`)
SELECT `extension_id`, 'COM_ADMIN_POSTINSTALL_MSG_HTACCESS_BROTLI_TITLE', 'COM_ADMIN_POSTINSTALL_MSG_HTACCESS_BROTLI_DESCRIPTION', '', 'com_admin', 1, 'message', '', '', 'admin://components/com_admin/postinstall/htaccessbrotli.php', 'admin_postinstall_htaccessbrotli_condition', '4.4.4', 1 FROM `#__extensions` WHERE `name` = 'files_joomla';
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
--
-- Add post-installation message about setting the Content-Encoding header in .htaccess
--
INSERT INTO "#__postinstall_messages" ("extension_id", "title_key", "description_key", "action_key", "language_extension", "language_client_id", "type", "action_file", "action", "condition_file", "condition_method", "version_introduced", "enabled")
SELECT "extension_id", 'COM_ADMIN_POSTINSTALL_MSG_HTACCESS_BROTLI_TITLE', 'COM_ADMIN_POSTINSTALL_MSG_HTACCESS_BROTLI_DESCRIPTION', '', 'com_admin', 1, 'message', '', '', 'admin://components/com_admin/postinstall/htaccessbrotli.php', 'admin_postinstall_htaccessbrotli_condition', '4.4.4', 1 FROM "#__extensions" WHERE "name" = 'files_joomla'
ON CONFLICT DO NOTHING;
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public static function getAssociationList($extensionName, $typeName, $itemId)
}

/**
* Get the the instance of the extension helper class
* Get the instance of the extension helper class
*
* @param string $extensionName The extension name with com_
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@ public function __construct($name, array $arguments = [])
}

/**
* Set used parameter to true
* Set abort and reason parameters.
*
* @param bool $value The value to set
* @param string $reason Abort reason
*
* @return void
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
echo ModuleHelper::renderModule($module, ['style' => 'well']);
}
?>
<?php if ($user->authorise('core.create', 'com_modules')) : ?>
<?php if ($user->authorise('core.admin', 'com_modules') && $user->authorise('core.create', 'com_modules')) : ?>
<div class="module-wrapper">
<div class="card">
<button type="button" data-bs-toggle="modal" data-bs-target="#moduleDashboardAddModal" class="cpanel-add-module">
Expand Down
2 changes: 1 addition & 1 deletion administrator/components/com_fields/forms/field.xml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
name="default_value"
type="textarea"
label="COM_FIELDS_FIELD_DEFAULT_VALUE_LABEL"
filter="raw"
filter="safehtml"
/>

<field
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ protected function getListQuery()
if (stripos($search, 'id:') === 0) {
$search = (int) substr($search, 3);
$query->where($db->quoteName('a.id') . ' = :search')
->bind(':id', $search, ParameterType::INTEGER);
->bind(':search', $search, ParameterType::INTEGER);
} else {
$search = '%' . str_replace(' ', '%', trim($search)) . '%';
$query->where($db->quoteName('a.title') . ' LIKE :search')
Expand Down
10 changes: 9 additions & 1 deletion administrator/components/com_finder/src/Indexer/Helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -247,8 +247,16 @@ public static function addContentType($title, $mime = null)
$db->setQuery($query);
$db->execute();

// Cache the result
$type = new \stdClass();
$type->title = $title;
$type->mime = $mime ?? '';
$type->id = (int) $db->insertid();

$types[$title] = $type;

// Return the new id.
return (int) $db->insertid();
return $type->id;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,7 @@ public function dates($idxQuery, $options)
*
* @return \stdClass[] Flat array of all nodes of a tree with the children after each parent
*
* @since __DEPLOY_VERSION__
* @since 4.4.4
*/
private function reduce(array $array)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,7 @@ public function compareUpdateVersion($extension)
/**
* Get a message of the tables skipped and checked
*
* @param array $status status of of the update files
* @param array $status status of the update files
*
* @return array Messages with the errors with the update version
*
Expand Down
6 changes: 6 additions & 0 deletions administrator/components/com_joomlaupdate/extract.php
Original file line number Diff line number Diff line change
Expand Up @@ -1406,6 +1406,9 @@ private function processTypeFileUncompressed(): bool
if ($this->dataReadLength == 0) {
// Before processing file data, ensure permissions are adequate
$this->setCorrectPermissions($this->fileHeader->file);

// This file is changed during the script's operation so we clear the status cache.
clearstatcache($this->fileHeader->file);
}

// Open the output file
Expand Down Expand Up @@ -1497,6 +1500,9 @@ private function processTypeFileCompressed(): bool
// Before processing file data, ensure permissions are adequate
$this->setCorrectPermissions($this->fileHeader->file);

// This file is changed during the script's operation so we clear the status cache.
clearstatcache($this->fileHeader->file);

// Open the output file
$outfp = @fopen($this->fileHeader->realFile, 'wb');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export default {
},
},
methods: {
/* Check if the the form is valid */
/* Check if the form is valid */
isValid() {
return (this.folder);
},
Expand Down
8 changes: 8 additions & 0 deletions administrator/components/com_menus/src/Helper/MenusHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -884,6 +884,14 @@ protected static function parseXmlNode($node, $replace = [])
$params->set('menu-quicktask-permission', (string) $node['quicktask-permission']);
}

if ($item->ajaxbadge) {
$params->set('ajax-badge', $item->ajaxbadge);
}

if ($item->dashboard) {
$params->set('dashboard', $item->dashboard);
}

// Translate attributes for iterator values
foreach ($replace as $var => $val) {
$item->title = str_replace("{sql:$var}", $val, $item->title);
Expand Down
6 changes: 3 additions & 3 deletions administrator/components/com_menus/src/View/Menu/XmlView.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public function display($tpl = null)
return;
}

$this->items = $root->getChildren(true);
$this->items = $root->getChildren();

$xml = new \SimpleXMLElement('<?xml version="1.0" encoding="UTF-8" ?><menu ' .
'xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ' .
Expand Down Expand Up @@ -175,8 +175,8 @@ protected function addXmlChild($xml, $item)
$node->addChild('params', htmlentities((string) $item->getParams(), ENT_XML1));
}

if (isset($item->submenu)) {
foreach ($item->submenu as $sub) {
if ($item->hasChildren()) {
foreach ($item->getChildren() as $sub) {
$this->addXmlChild($node, $sub);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ protected function getGroups()
/**
* Method to get the users to exclude from the list of users
*
* @return array|null array of users to exclude or null to to not exclude them
* @return array|null array of users to exclude or null to not exclude them
*
* @since 1.6
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,8 @@ public function nextExec(bool $string = true, bool $basisNow = false)
case 'cron-expression':
// @todo: testing
$cExp = new CronExpression((string) $this->rule->exp);
$nextExec = $cExp->getNextRunDate('now', 0, false, 'UTC');
$nextExec = $cExp->getNextRunDate('now', 0, false, Factory::getApplication()->get('offset', 'UTC'));
$nextExec->setTimezone(new \DateTimeZone('UTC'));
$nextExec = $string ? $this->dateTimeToSql($nextExec) : $nextExec;
break;
default:
Expand Down
12 changes: 12 additions & 0 deletions administrator/components/com_scheduler/src/Model/TaskModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,18 @@ protected function loadFormData()
$data->execution_rules['exec-day'] = gmdate('d');
$data->execution_rules['exec-time'] = gmdate('H:i');
}

if ($data->next_execution) {
$data->next_execution = Factory::getDate($data->next_execution);
$data->next_execution->setTimezone(new \DateTimeZone($this->app->get('offset', 'UTC')));
$data->next_execution = $data->next_execution->toSql(true);
}

if ($data->last_execution) {
$data->last_execution = Factory::getDate($data->last_execution);
$data->last_execution->setTimezone(new \DateTimeZone($this->app->get('offset', 'UTC')));
$data->last_execution = $data->last_execution->toSql(true);
}
}

// Let plugins manipulate the data
Expand Down
Loading

0 comments on commit ee585f5

Please sign in to comment.