Skip to content

Commit

Permalink
Merge branch '4.4-dev' into 5.0/upmerge
Browse files Browse the repository at this point in the history
# Conflicts:
#	administrator/components/com_admin/script.php
#	composer.json
#	composer.lock
#	package-lock.json
  • Loading branch information
HLeithner committed May 29, 2023
2 parents 0b5f709 + 18a29a6 commit df11fcf
Show file tree
Hide file tree
Showing 105 changed files with 2,196 additions and 387 deletions.
9 changes: 9 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Short array syntax change https://github.com/joomla/joomla-cms/pull/39616
10f250f418851674c2e4104b6b39b9b665496544

# Code style fixes from PHP CS fixer https://github.com/joomla/joomla-cms/pull/39745
1e7527b60ec42032abe7bfb9c000bacf38f65845

# PSR 12
dd91072a956a19a43798515239892edd2b49ac7b
e7f5cc182bb1cd39c7f085d529888ac4fa6fc77e
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
INSERT INTO `#__extensions` (`package_id`, `name`, `type`, `element`, `folder`, `client_id`, `enabled`, `access`, `protected`, `locked`, `manifest_cache`, `params`, `custom_data`, `ordering`, `state`) VALUES
(0, 'plg_quickicon_eos', 'plugin', 'eos', 'quickicon', 0, 1, 1, 0, 1, '', '', '', 7, 0);
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
INSERT INTO "#__extensions" ("package_id", "name", "type", "element", "folder", "client_id", "enabled", "access", "protected", "locked", "manifest_cache", "params", "custom_data", "ordering", "state") VALUES
(0, 'plg_quickicon_eos', 'plugin', 'eos', 'quickicon', 0, 1, 1, 0, 1, '', '', '', 7, 0);
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ class BannerModel extends AdminModel
*
* @return void
*
* @since __DEPLOY_VERSION__
* @since 4.3.2
*/
protected function cleanupPostBatchCopy(TableInterface $table, $newId, $oldId)
{
Expand Down
39 changes: 39 additions & 0 deletions administrator/language/en-GB/plg_quickicon_eos.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
; Joomla! Project
; (C) 2023 Open Source Matters, Inc. <https://www.joomla.org>
; License GNU General Public License version 2 or later; see LICENSE.txt
; Note : All ini files need to be saved as UTF-8

PLG_QUICKICON_EOS="Quick Icon - Joomla! End Of Support Notification"
PLG_QUICKICON_EOS_GROUPNAME_EOS="End Of Support"
PLG_QUICKICON_EOS_GROUPNAME_INFO="Upgrade Information"
PLG_QUICKICON_EOS_GROUPNAME_WARNING="Support Status"
PLG_QUICKICON_EOS_MESSAGE_ERROR_SUPPORT_ENDED="<p>Support has ended for your version of Joomla. <a href=\"%2$s\" target=\"_blank\" rel=\"noopener noreferrer\">Migrate to the next version</a> as soon as possible.</p>"
PLG_QUICKICON_EOS_MESSAGE_ERROR_SUPPORT_ENDED_SHORT="Support has ended for your version of Joomla <span class=\"icon-new-tab\"></span>"
PLG_QUICKICON_EOS_MESSAGE_INFO_01="<p>The latest version of Joomla has arrived! Find out all that it has to offer you. Check the landing page for <a href=\"%2$s\" target=\"_blank\" rel=\"noopener noreferrer\">its features</a> and improvements.</p>"
PLG_QUICKICON_EOS_MESSAGE_INFO_01_SHORT="The latest version of Joomla has arrived! <span class=\"icon-new-tab\"></span>"
PLG_QUICKICON_EOS_MESSAGE_INFO_02="<p>When is the time to migrate to the next version? Once the extensions your site needs are compatible. Learn <a href=\"%2$s\" target=\"_blank\" rel=\"noopener noreferrer\">how to use the Pre-Update Checker</a>. </p>"
PLG_QUICKICON_EOS_MESSAGE_INFO_02_SHORT="Use Pre-Update Check for extension compatibility <span class=\"icon-new-tab\"></span>"
PLG_QUICKICON_EOS_MESSAGE_WARNING_SECURITY_ONLY="<p>This version of Joomla has entered security only mode. Support ends %1$s. Start <a href=\"%2$s\" target=\"_blank\" rel=\"noopener noreferrer\">planning to migrate</a> to the next version of Joomla today.</p>"
PLG_QUICKICON_EOS_MESSAGE_WARNING_SECURITY_ONLY_SHORT="This version of Joomla ends support on %1$s. <span class=\"icon-new-tab\"></span>"
PLG_QUICKICON_EOS_MESSAGE_WARNING_SUPPORT_ENDING="<p>Support ends on %1$s for this version of Joomla. <a href=\"%2$s\" target=\"_blank\" rel=\"noopener noreferrer\">Migrate to the latest version of Joomla</a> as soon as possible.</p>"
PLG_QUICKICON_EOS_MESSAGE_WARNING_SUPPORT_ENDING_SHORT="End of support for this version of Joomla on %1$s. <span class=\"icon-new-tab\"></span>"
PLG_QUICKICON_EOS_SNOOZE_BUTTON="Snooze this message for all users"
PLG_QUICKICON_EOS_XML_DESCRIPTION="Checks for the end of support status of Joomla and notifies you when visiting the Control Panel page."
; Below is a copy of the 3.10 text definitions for reference.
PLG_QUICKICON_EOS310="Quick Icon - Joomla 3.10 End Of Support Notification"
PLG_QUICKICON_EOS310_GROUPNAME_EOS="End Of Support"
PLG_QUICKICON_EOS310_GROUPNAME_INFO="Upgrade Information"
PLG_QUICKICON_EOS310_GROUPNAME_WARNING="Support Status"
PLG_QUICKICON_EOS310_MESSAGE_ERROR_SUPPORT_ENDED="<p>Support has ended for your version of Joomla 3.10. <a href=\"%2$s\" target=\"_blank\" rel=\"noopener noreferrer\">Migrate to Joomla 4</a> <span class=\"icon-new-tab\"></span>as soon as possible.</p>"
PLG_QUICKICON_EOS310_MESSAGE_ERROR_SUPPORT_ENDED_SHORT="Support has ended for Joomla 3.10 <span class=\"icon-new-tab\"></span>"
PLG_QUICKICON_EOS310_MESSAGE_INFO_01="<p>Joomla 4 has arrived! Find out all that Joomla 4 has to offer you. Check the landing page for <a href=\"%2$s\" target=\"_blank\" rel=\"noopener noreferrer\">Joomla 4 features</a> <span class=\"icon-new-tab\"></span>and improvements.</p>"
PLG_QUICKICON_EOS310_MESSAGE_INFO_01_SHORT="Joomla 4 has arrived! <span class=\"icon-new-tab\"></span>"
PLG_QUICKICON_EOS310_MESSAGE_INFO_02="<p>When is the time to migrate to Joomla 4? Once the extensions your site needs are compatible. Learn <a href=\"%2$s\" target=\"_blank\" rel=\"noopener noreferrer\">how to use the Pre-Update Checker</a>. <span class=\"icon-new-tab\"></span></p>"
PLG_QUICKICON_EOS310_MESSAGE_INFO_02_SHORT="Use Pre-Update Check for extension compatibility <span class=\"icon-new-tab\"></span>"
PLG_QUICKICON_EOS310_MESSAGE_WARNING_SECURITY_ONLY="<p>Joomla 3.10 has entered security only mode. Support ends %1$s. Start <a href=\"%2$s\" target=\"_blank\" rel=\"noopener noreferrer\">planning to migrate</a> <span class=\"icon-new-tab\"></span>to Joomla 4 today.</p>"
PLG_QUICKICON_EOS310_MESSAGE_WARNING_SECURITY_ONLY_SHORT="Joomla 3.10 to end support on %1$s. <span class=\"icon-new-tab\"></span>"
PLG_QUICKICON_EOS310_MESSAGE_WARNING_SUPPORT_ENDING="<p>Support ends on %1$s for Joomla 3.10. <a href=\"%2$s\" target=\"_blank\" rel=\"noopener noreferrer\">Migrate to Joomla 4</a> <span class=\"icon-new-tab\"></span>as soon as possible.</p>"
PLG_QUICKICON_EOS310_MESSAGE_WARNING_SUPPORT_ENDING_SHORT="End of support for Joomla 3.10 on %1$s. <span class=\"icon-new-tab\"></span>"
PLG_QUICKICON_EOS310_SNOOZE_BUTTON="Snooze this message for all users"
PLG_QUICKICON_EOS310_XML_DESCRIPTION="Checks for the end of support status of Joomla 3.10 and notifies you when visiting the Control Panel page."
;All of this text is currently being written for Joomla 5 by Phil Watson and Jenn Gress. TODO
7 changes: 7 additions & 0 deletions administrator/language/en-GB/plg_quickicon_eos.sys.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
; Joomla! Project
; (C) 2023 Open Source Matters, Inc. <https://www.joomla.org>
; License GNU General Public License version 2 or later; see LICENSE.txt
; Note : All ini files need to be saved as UTF-8

PLG_QUICKICON_EOS="Quick Icon - Joomla! End Of Support Notification"
PLG_QUICKICON_EOS_XML_DESCRIPTION="Checks for the end of support status of Joomla and places a notification on the Control Panel page."
6 changes: 3 additions & 3 deletions build/media_source/com_users/js/two-factor-focus.es6.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
document.addEventListener('DOMContentLoaded', () => {
const elCodeField = document.getElementById('users-mfa-code');
const elValidateButton = document.getElementById('users-mfa-captive-button-submit');
const elToolbarCustomElement = document.getElementById('toolbar-user-mfa-submit');
const elToolbarButton = document.getElementById('toolbar-user-mfa-submit')?.querySelector('button');

// Focus the code field. If the code field is hidden, focus the submit button (useful e.g. for WebAuthn)
if (
Expand All @@ -21,8 +21,8 @@
if (elValidateButton) {
elValidateButton.focus();
}
if (elToolbarCustomElement) {
elToolbarCustomElement.querySelector('button').focus();
if (elToolbarButton) {
elToolbarButton.focus();
}
}

Expand Down
37 changes: 37 additions & 0 deletions build/media_source/plg_quickicon_eos/js/snooze.es6.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/**
* @package Joomla.Plugin
* @subpackage Quickicon.eos
* @copyright (C) 2023 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
if (!Joomla) {
throw new Error('Joomla API is not properly initialised');
}

const url = new URL(`${Joomla.getOptions('system.paths').baseFull}index.php?option=com_ajax&group=quickicon&plugin=eos&format=json`);

async function onMutatedMessagesContainer(mutationList, observer) {
// eslint-disable-next-line no-restricted-syntax
for (const mutation of mutationList) {
const nodes = Array.from(mutation.addedNodes);
if (!nodes.length) {
return;
}

const alerts = nodes.filter((node) => node.querySelector('.eosnotify-snooze-btn'));
if (!alerts.length) {
return;
}

observer.disconnect();
alerts[0].querySelector('.eosnotify-snooze-btn').addEventListener('click', () => fetch(url, { headers: { 'X-CSRF-Token': Joomla.getOptions('csrf.token') || '' } })
.then((response) => {
if (response.ok) {
alerts[0].closest('joomla-alert').close();
}
}));
}
}

const observer = new MutationObserver(onMutatedMessagesContainer);
observer.observe(document.querySelector('#system-message-container'), { attributes: false, childList: true, subtree: true });
20 changes: 15 additions & 5 deletions build/media_source/system/js/list-view.es6.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,18 @@ function applyIsChecked(event) {
}
}

document.querySelectorAll('.js-grid-item-check-all').forEach((element) => element.addEventListener('click', (event) => Joomla.checkAll(event.target)));
document.querySelectorAll('.js-grid-item-is-checked').forEach((element) => element.addEventListener('click', applyIsChecked));
document.querySelectorAll('.js-grid-item-action').forEach((element) => element.addEventListener('click', gridItemAction));
document.querySelectorAll('.js-grid-item-transition-action').forEach((element) => element.addEventListener('change', gridTransitionItemAction));
document.querySelectorAll('.js-grid-button-transition-action').forEach((element) => element.addEventListener('click', gridTransitionButtonAction));
/*
* Set up an interactive list elements
*
* @param {Event} event
*/
const setup = ({ target }) => {
target.querySelectorAll('.js-grid-item-check-all').forEach((element) => element.addEventListener('click', (event) => Joomla.checkAll(event.target)));
target.querySelectorAll('.js-grid-item-is-checked').forEach((element) => element.addEventListener('click', applyIsChecked));
target.querySelectorAll('.js-grid-item-action').forEach((element) => element.addEventListener('click', gridItemAction));
target.querySelectorAll('.js-grid-item-transition-action').forEach((element) => element.addEventListener('change', gridTransitionItemAction));
target.querySelectorAll('.js-grid-button-transition-action').forEach((element) => element.addEventListener('click', gridTransitionButtonAction));
};

setup({ target: document });
document.addEventListener('joomla:updated', setup);
4 changes: 2 additions & 2 deletions components/com_content/tmpl/category/blog_links.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@

?>

<ul class="com-content-blog__links">
<ol class="com-content-blog__links">
<?php foreach ($this->link_items as $item) : ?>
<li class="com-content-blog__link">
<a href="<?php echo Route::_(RouteHelper::getArticleRoute($item->slug, $item->catid, $item->language)); ?>">
<?php echo $item->title; ?></a>
</li>
<?php endforeach; ?>
</ul>
</ol>
8 changes: 3 additions & 5 deletions components/com_users/tmpl/captive/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,10 @@
* @var HtmlView $this View object
* @var CaptiveModel $model The model
*/
$model = $this->getModel();
$model = $this->getModel();

if ($this->renderOptions['field_type'] !== 'custom') {
$this->document->getWebAssetManager()
->useScript('com_users.two-factor-focus');
}
$this->document->getWebAssetManager()
->useScript('com_users.two-factor-focus');

?>
<div class="users-mfa-captive card card-body">
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
"fig/link-util": "^1.1.2",
"google/recaptcha": "^1.2.4",
"laminas/laminas-diactoros": "^2.4.1",
"paragonie/sodium_compat": "^1.19",
"paragonie/sodium_compat": "^1.20",
"phpmailer/phpmailer": "^6.8.0",
"psr/link": "~1.1.0",
"symfony/console": "^6.2.7",
Expand All @@ -98,7 +98,7 @@
"lcobucci/jwt": "^4.2.1",
"web-token/signature-pack": "^3.1.2",
"phpseclib/bcmath_compat": "^2.0.1",
"jfcherng/php-diff": "^6.10.11",
"jfcherng/php-diff": "^6.10.12",
"voku/portable-utf8": "6.0.12 as 5.4.0"
},
"require-dev": {
Expand Down
1 change: 1 addition & 0 deletions installation/sql/mysql/base.sql
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,7 @@ INSERT INTO `#__extensions` (`package_id`, `name`, `type`, `element`, `folder`,
(0, 'plg_quickicon_downloadkey', 'plugin', 'downloadkey', 'quickicon', 0, 1, 1, 0, 1, '', '', '', 4, 0),
(0, 'plg_quickicon_privacycheck', 'plugin', 'privacycheck', 'quickicon', 0, 1, 1, 0, 1, '', '{}', '', 5, 0),
(0, 'plg_quickicon_phpversioncheck', 'plugin', 'phpversioncheck', 'quickicon', 0, 1, 1, 0, 1, '', '', '', 6, 0),
(0, 'plg_quickicon_eos', 'plugin', 'eos', 'quickicon', 0, 1, 1, 0, 1, '', '', '', 7, 0),
(0, 'plg_sampledata_blog', 'plugin', 'blog', 'sampledata', 0, 1, 1, 0, 1, '', '', '', 1, 0),
(0, 'plg_sampledata_multilang', 'plugin', 'multilang', 'sampledata', 0, 1, 1, 0, 1, '', '', '', 2, 0),
(0, 'plg_system_accessibility', 'plugin', 'accessibility', 'system', 0, 0, 1, 0, 1, '', '{}', '', 1, 0),
Expand Down
1 change: 1 addition & 0 deletions installation/sql/postgresql/base.sql
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,7 @@ INSERT INTO "#__extensions" ("package_id", "name", "type", "element", "folder",
(0, 'plg_quickicon_downloadkey', 'plugin', 'downloadkey', 'quickicon', 0, 1, 1, 0, 1, '', '', '', 4, 0),
(0, 'plg_quickicon_privacycheck', 'plugin', 'privacycheck', 'quickicon', 0, 1, 1, 0, 1, '', '{}', '', 5, 0),
(0, 'plg_quickicon_phpversioncheck', 'plugin', 'phpversioncheck', 'quickicon', 0, 1, 1, 0, 1, '', '', '', 6, 0),
(0, 'plg_quickicon_eos', 'plugin', 'eos', 'quickicon', 0, 1, 1, 0, 1, '', '', '', 7, 0),
(0, 'plg_sampledata_blog', 'plugin', 'blog', 'sampledata', 0, 1, 1, 0, 1, '', '', '', 1, 0),
(0, 'plg_sampledata_multilang', 'plugin', 'multilang', 'sampledata', 0, 1, 1, 0, 1, '', '', '', 2, 0),
(0, 'plg_system_accessibility', 'plugin', 'accessibility', 'system', 0, 0, 1, 0, 1, '', '{}', '', 1, 0),
Expand Down
2 changes: 1 addition & 1 deletion libraries/src/Categories/Categories.php
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ public function getExtension()
*
* @return array
*
* @since __DEPLOY_VERSION__
* @since 4.3.2
*/
public function getOptions()
{
Expand Down
4 changes: 2 additions & 2 deletions libraries/src/Categories/CategoryNode.php
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,7 @@ public function getNumItems($recursive = false)
/**
* Serialize the node.
*
* @since __DEPLOY_VERSION__
* @since 4.3.2
*/
public function __serialize()
{
Expand All @@ -508,7 +508,7 @@ public function __serialize()
*
* @param array $data
*
* @since __DEPLOY_VERSION__
* @since 4.3.2
*/
public function __unserialize($data)
{
Expand Down
1 change: 1 addition & 0 deletions libraries/src/Extension/ExtensionHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,7 @@ class ExtensionHelper
['plugin', 'overridecheck', 'quickicon', 0],
['plugin', 'phpversioncheck', 'quickicon', 0],
['plugin', 'privacycheck', 'quickicon', 0],
['plugin', 'eos', 'quickicon', 0],

// Core plugin extensions - sample data
['plugin', 'blog', 'sampledata', 0],
Expand Down
10 changes: 5 additions & 5 deletions libraries/src/Form/Field/MediaField.php
Original file line number Diff line number Diff line change
Expand Up @@ -293,9 +293,9 @@ public function getLayoutData()
$this->folder = $adapter . ':' . $path;
} elseif ($this->value && is_file(JPATH_ROOT . '/' . $this->value)) {
/**
* Local image, for example images/sampledata/cassiopeia/nasa2-640.jpg . We need to validate and make sure
* the top level folder is one of the directory configured in filesystem local plugin to avoid error message
* displayed in manage when users click on Select button to select a new image
* Local image, for example images/sampledata/cassiopeia/nasa2-640.jpg. We need to validate and make sure
* the top level folder is one of the directories configured in the filesystem local plugin to avoid an error
* message being displayed when users click on Select button to select a new image.
*/
$paths = explode('/', Path::clean($this->value, '/'));

Expand All @@ -310,8 +310,8 @@ public function getLayoutData()
/**
* This is the case where a folder is configured in directory attribute of the form field. The directory needs
* to be a relative folder of the folder configured in Path to Images Folder config option of Media component.
* Same with a already stored local image above, we need to validate and make sure top level folder is one of the directory
* configured in filesystem local plugin
* Same with an already stored local image above, we need to validate and make sure the top level folder is one of the
* directories configured in the filesystem local plugin.
*/
$path = ComponentHelper::getParams('com_media')->get('image_path', 'images') . '/' . $this->directory;
$paths = explode('/', Path::clean($path, '/'));
Expand Down
2 changes: 1 addition & 1 deletion libraries/src/WebAsset/WebAssetItem.php
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,6 @@ protected function isPathExternal(string $path): bool
protected function isPathAbsolute(string $path): bool
{
// We have a full path or not
return is_file(JPATH_ROOT . '/' . $path);
return strpos($path, '/') !== false && is_file(JPATH_ROOT . '/' . $path);
}
}
11 changes: 8 additions & 3 deletions libraries/src/Workflow/WorkflowPluginTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ protected function enhanceWorkflowTransitionForm(Form $form, $data)
// Load XML file from "parent" plugin
$path = dirname((new ReflectionClass(static::class))->getFileName());

if (!is_file($path . '/forms/action.xml')) {
$path = JPATH_PLUGINS . '/' . $this->_type . '/' . $this->_name;
}

if (is_file($path . '/forms/action.xml')) {
$form->loadFile($path . '/forms/action.xml');
}
Expand All @@ -65,13 +69,14 @@ protected function enhanceWorkflowTransitionForm(Form $form, $data)
*/
protected function getWorkflow(int $workflowId = null)
{
$workflowId = !empty($workflowId) ? $workflowId : $this->app->getInput()->getInt('workflow_id');
$app = $this->getApplication() ?? $this->app;
$workflowId = !empty($workflowId) ? $workflowId : $app->getInput()->getInt('workflow_id');

if (is_array($workflowId)) {
return false;
}

return $this->app->bootComponent('com_workflow')
return $app->bootComponent('com_workflow')
->getMVCFactory()
->createModel('Workflow', 'Administrator', ['ignore_request' => true])
->getItem($workflowId);
Expand Down Expand Up @@ -134,7 +139,7 @@ protected function checkExtensionSupport($context, $functionality)
{
$parts = explode('.', $context);

$component = $this->app->bootComponent($parts[0]);
$component = ($this->getApplication() ?? $this->app)->bootComponent($parts[0]);

if (
!$component instanceof WorkflowServiceInterface
Expand Down
Loading

0 comments on commit df11fcf

Please sign in to comment.