Skip to content

Commit

Permalink
Merge branch '4.4-dev' into patch-13
Browse files Browse the repository at this point in the history
  • Loading branch information
richard67 committed Dec 20, 2023
2 parents d058269 + 1b4fea4 commit c846fd3
Show file tree
Hide file tree
Showing 80 changed files with 2,543 additions and 2,582 deletions.
4 changes: 2 additions & 2 deletions .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,16 +46,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
63 changes: 36 additions & 27 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:18-bullseye-slim
image: node:20-bullseye-slim
depends_on: [ phpcs ]
volumes:
- name: npm-cache
Expand Down Expand Up @@ -376,29 +376,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:
branch:
- 4.4-dev
- 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 @@ -425,8 +435,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 @@ -439,20 +449,19 @@ 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 4.4](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 4.4](https://developer.joomla.org/nightly-builds.html) FAILED to built."}' $MATTERMOST_NIGHTLY_HOOK
when:
status:
- failure


trigger:
event:
- cron
Expand All @@ -462,6 +471,6 @@ trigger:

---
kind: signature
hmac: c80f54f77ce8c648018d3946dc20d86bf3491484662a0e5defd8d9453f33cd92
hmac: 668e2a3bfab925caf4bc0062eaf622d2527f3b8d805e21b663ff1dd89897a431

...
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Build Status
---------------------
| Drone-CI | AppVeyor | PHP | Node | npm |
| ------------- | ------------- | ------------- | ------------- | ------------- |
| [![Build Status](https://ci.joomla.org/api/badges/joomla/joomla-cms/status.svg?branch=4.4-dev)](https://ci.joomla.org/joomla/joomla-cms) | [![Build status](https://ci.appveyor.com/api/projects/status/ru6sxal8jmfckvjc/branch/4.4-dev?svg=true)](https://ci.appveyor.com/project/release-joomla/joomla-cms) | [![PHP](https://img.shields.io/badge/PHP-V7.2.5-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/) |
| [![Build Status](https://ci.joomla.org/api/badges/joomla/joomla-cms/status.svg?branch=4.4-dev)](https://ci.joomla.org/joomla/joomla-cms) | [![Build status](https://ci.appveyor.com/api/projects/status/ru6sxal8jmfckvjc/branch/4.4-dev?svg=true)](https://ci.appveyor.com/project/release-joomla/joomla-cms) | [![PHP](https://img.shields.io/badge/PHP-V7.2.5-green)](https://www.php.net/) | [![node-lts](https://img.shields.io/badge/Node-V20.0-green)](https://nodejs.org/en/) | [![npm](https://img.shields.io/badge/npm-v10.1.0-green)](https://nodejs.org/en/) |

Overview
---------------------
Expand Down
4 changes: 4 additions & 0 deletions administrator/components/com_admin/script.php
Original file line number Diff line number Diff line change
Expand Up @@ -8151,6 +8151,10 @@ public function updateAssets($installer)
// List all components added since 4.0
$newComponents = [
// Components to be added here
'com_guidedtours',
'com_mails',
'com_scheduler',
'com_workflow',
];

foreach ($newComponents as $component) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ protected function addToolbar()

$childBar = $dropdown->getChildToolbar();

if (\count($this->transitions)) {
if ($canDo->get('core.execute.transition') && \count($this->transitions)) {
$childBar->separatorButton('transition-headline')
->text('COM_CONTENT_RUN_TRANSITIONS')
->buttonClass('text-center py-2 h3');
Expand Down
48 changes: 28 additions & 20 deletions administrator/components/com_content/tmpl/articles/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -152,23 +152,39 @@
endif; ?>>
<?php foreach ($this->items as $i => $item) :
$item->max_ordering = 0;
$canEdit = $user->authorise('core.edit', 'com_content.article.' . $item->id);
$canCheckin = $user->authorise('core.manage', 'com_checkin') || $item->checked_out == $userId || is_null($item->checked_out);
$canEditOwn = $user->authorise('core.edit.own', 'com_content.article.' . $item->id) && $item->created_by == $userId;
$canChange = $user->authorise('core.edit.state', 'com_content.article.' . $item->id) && $canCheckin;
$canEditCat = $user->authorise('core.edit', 'com_content.category.' . $item->catid);
$canEditOwnCat = $user->authorise('core.edit.own', 'com_content.category.' . $item->catid) && $item->category_uid == $userId;
$canEditParCat = $user->authorise('core.edit', 'com_content.category.' . $item->parent_category_id);
$canEditOwnParCat = $user->authorise('core.edit.own', 'com_content.category.' . $item->parent_category_id) && $item->parent_category_uid == $userId;
$canEdit = $user->authorise('core.edit', 'com_content.article.' . $item->id);
$canCheckin = $user->authorise('core.manage', 'com_checkin') || $item->checked_out == $userId || is_null($item->checked_out);
$canEditOwn = $user->authorise('core.edit.own', 'com_content.article.' . $item->id) && $item->created_by == $userId;
$canChange = $user->authorise('core.edit.state', 'com_content.article.' . $item->id) && $canCheckin;
$canExecuteTransition = $user->authorise('core.execute.transition', 'com_content.article.' . $item->id);
$canEditCat = $user->authorise('core.edit', 'com_content.category.' . $item->catid);
$canEditOwnCat = $user->authorise('core.edit.own', 'com_content.category.' . $item->catid) && $item->category_uid == $userId;
$canEditParCat = $user->authorise('core.edit', 'com_content.category.' . $item->parent_category_id);
$canEditOwnParCat = $user->authorise('core.edit.own', 'com_content.category.' . $item->parent_category_id) && $item->parent_category_uid == $userId;

$transitions = ContentHelper::filterTransitions($this->transitions, (int) $item->stage_id, (int) $item->workflow_id);
// Transition button options
$options = [
'title' => Text::_($item->stage_title),
'tip_content' => Text::sprintf('JWORKFLOW', Text::_($item->workflow_title)),
'id' => 'workflow-' . $item->id,
'task' => 'articles.runTransition',
'disabled' => !$canExecuteTransition,
];

$transition_ids = ArrayHelper::getColumn($transitions, 'value');
$transition_ids = ArrayHelper::toInteger($transition_ids);
if ($canExecuteTransition) {
$transitions = ContentHelper::filterTransitions($this->transitions, (int) $item->stage_id, (int) $item->workflow_id);

$transition_ids = ArrayHelper::getColumn($transitions, 'value');
$transition_ids = ArrayHelper::toInteger($transition_ids);

$dataTransitionsAttribute = 'data-transitions="' . implode(',', $transition_ids) . '"';

$options = array_merge($options, ['transitions' => $transitions]);
}

?>
<tr class="row<?php echo $i % 2; ?>" data-draggable-group="<?php echo $item->catid; ?>"
data-transitions="<?php echo implode(',', $transition_ids); ?>"
<?php echo $dataTransitionsAttribute ?? '' ?>
>
<td class="text-center">
<?php echo HTMLHelper::_('grid.id', $i, $item->id, false, 'cid', 'cb', $item->title); ?>
Expand All @@ -192,14 +208,6 @@
<?php if ($workflow_enabled) : ?>
<td class="article-stage text-center">
<?php
$options = [
'transitions' => $transitions,
'title' => Text::_($item->stage_title),
'tip_content' => Text::sprintf('JWORKFLOW', Text::_($item->workflow_title)),
'id' => 'workflow-' . $item->id,
'task' => 'articles.runTransition'
];

echo (new TransitionButton($options))
->render(0, $i);
?>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@
-2 => 'icon-trash',
0 => 'icon-times',
1 => 'icon-check',
2 => 'icon-archive',
];
?>
<?php foreach ($this->items as $i => $item) : ?>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@
<?php endif; ?>
</td>
<td class="d-none d-md-table-cell">
<?php echo htmlspecialchars($item->editor); ?>
<?php echo empty($item->editor) ? $item->editor_user_id : htmlspecialchars($item->editor); ?>
</td>
<td class="text-end">
<?php echo number_format((int) $item->character_count, 0, Text::_('DECIMALS_SEPARATOR'), Text::_('THOUSANDS_SEPARATOR')); ?>
Expand Down
6 changes: 3 additions & 3 deletions administrator/components/com_finder/src/Indexer/Parser.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,13 +97,13 @@ public function parse($input)
// Find the last space character if we aren't at the end.
$ls = (($start + $chunk) < $end ? strrpos($string, ' ') : false);

// Truncate to the last space character.
// Truncate to the last space character (but include it in the string).
if ($ls !== false) {
$string = substr($string, 0, $ls);
$string = substr($string, 0, $ls + 1);
}

// Adjust the start position for the next iteration.
$start += ($ls !== false ? ($ls + 1 - $chunk) + $chunk : $chunk);
$start += $ls !== false ? $ls + 1 : $chunk;

// Parse the chunk.
$return .= $this->process($string);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public function update()
$redirect_url = $app->getUserState('com_installer.redirect_url');

// Don't redirect to an external URL.
if (!Uri::isInternal($redirect_url)) {
if ($redirect_url && !Uri::isInternal($redirect_url)) {
$redirect_url = '';
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,24 @@ class HtmlView extends BaseHtmlView
*/
protected $messagePrefix = '';

/**
* A special text used for the emptystate layout to explain why there is no download
*
* @var string The message
*
* @since 4.4.0
*/
protected $reasonNoDownload = '';

/**
* Details on failed PHP or DB version requirements to be shown in the emptystate layout when there is no download
*
* @var \stdClass PHP and database requirements from the update manifest
*
* @since __DEPLOY_VERSION__
*/
protected $detailsNoDownload;

/**
* List of non core critical plugins
*
Expand Down Expand Up @@ -190,7 +208,9 @@ public function display($tpl = null)
} else {
// No download available
if ($hasUpdate) {
$this->messagePrefix = '_NODOWNLOAD';
$this->messagePrefix = '_NODOWNLOAD';
$this->reasonNoDownload = 'COM_JOOMLAUPDATE_NODOWNLOAD_EMPTYSTATE_REASON';
$this->detailsNoDownload = $this->updateInfo['object']->get('otherUpdateInfo');
}

$this->setLayout('noupdate');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,35 @@
use Joomla\CMS\Layout\LayoutHelper;
use Joomla\CMS\Session\Session;

$uploadLink = 'index.php?option=com_joomlaupdate&view=upload';
$uploadLink = 'index.php?option=com_joomlaupdate&view=upload';
$reasonNoDownload = '';

if (!empty($this->reasonNoDownload)) {
$reasonNoDownload = Text::_($this->reasonNoDownload);

if (isset($this->detailsNoDownload->php)) {
$reasonNoDownload .= Text::sprintf(
'COM_JOOMLAUPDATE_NODOWNLOAD_EMPTYSTATE_REASON_PHP',
$this->detailsNoDownload->php->used,
$this->detailsNoDownload->php->required
);
}

if (isset($this->detailsNoDownload->db)) {
$reasonNoDownload .= Text::sprintf(
'COM_JOOMLAUPDATE_NODOWNLOAD_EMPTYSTATE_REASON_DATABASE',
Text::_('JLIB_DB_SERVER_TYPE_' . $this->detailsNoDownload->db->type),
$this->detailsNoDownload->db->used,
$this->detailsNoDownload->db->required
);
}

$reasonNoDownload .= Text::_('COM_JOOMLAUPDATE_NODOWNLOAD_EMPTYSTATE_REASON_ACTION');
}

$displayData = [
'textPrefix' => 'COM_JOOMLAUPDATE' . $this->messagePrefix,
'content' => Text::sprintf($this->langKey, $this->updateSourceKey),
'content' => $reasonNoDownload . Text::sprintf($this->langKey, $this->updateSourceKey),
'formURL' => 'index.php?option=com_joomlaupdate&view=joomlaupdate',
'helpURL' => 'https://docs.joomla.org/Special:MyLanguage/Updating_from_an_existing_version',
'icon' => 'icon-loop joomlaupdate',
Expand Down
2 changes: 1 addition & 1 deletion administrator/components/com_media/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
type="textarea"
label="COM_MEDIA_FIELD_RESTRICT_UPLOADS_EXTENSIONS_LABEL"
description="COM_MEDIA_FIELD_RESTRICT_UPLOADS_EXTENSIONS_DESC"
default="bmp,gif,jpg,jpeg,png,webp,ico,mp3,mp4,odg,odp,ods,odt,pdf,png,ppt,txt,xcf,xls,csv"
default="bmp,gif,jpg,jpeg,png,webp,ico,mp3,mp4,odg,odp,ods,odt,pdf,ppt,txt,xcf,xls,csv"
showon="restrict_uploads:1"
/>

Expand Down
14 changes: 8 additions & 6 deletions administrator/components/com_users/tmpl/users/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -147,14 +147,17 @@
<?php endif; ?>
</td>
<td class="text-center d-md-table-cell">
<?php
$activated = empty($item->activation) ? 0 : 1;
echo HTMLHelper::_('jgrid.state', HTMLHelper::_('users.activateStates'), $activated, $i, 'users.', (bool) $activated);
?>
<?php if (empty($item->activation)) : ?>
<span class="icon-check" aria-hidden="true" aria-describedby="tip-activated<?php echo $i; ?>"></span>
<div role="tooltip" id="tip-activated<?php echo $i; ?>">
<?php echo Text::_('COM_USERS_ACTIVATED'); ?>
</div>
<?php else : ?>
<?php echo HTMLHelper::_('jgrid.state', HTMLHelper::_('users.activateStates'), 1, $i, 'users.', true); ?>
<?php endif; ?>
</td>
<?php if ($mfa) : ?>
<td class="text-center d-none d-md-table-cell">
<span class="tbody-icon">
<?php if ($item->mfaRecords > 0 || !empty($item->otpKey)) : ?>
<span class="icon-check" aria-hidden="true" aria-describedby="tip-mfa<?php echo $i; ?>"></span>
<div role="tooltip" id="tip-mfa<?php echo $i; ?>">
Expand All @@ -166,7 +169,6 @@
<?php echo Text::_('COM_USERS_MFA_NOTACTIVE'); ?>
</div>
<?php endif; ?>
</span>
</td>
<?php endif; ?>
<td class="d-none d-md-table-cell">
Expand Down

0 comments on commit c846fd3

Please sign in to comment.