From 90ee7905b0c217ee8d7296b599104dc3de0fe84f Mon Sep 17 00:00:00 2001 From: Benjamin Trenkle Date: Sat, 1 Jan 2022 23:05:36 +0100 Subject: [PATCH 01/28] Bump to 4.1.0 Beta 3 --- administrator/language/en-GB/install.xml | 2 +- administrator/language/en-GB/langmetadata.xml | 2 +- administrator/manifests/files/joomla.xml | 4 ++-- administrator/manifests/packages/pkg_en-GB.xml | 2 +- .../src/Controller/CategoriesController.php | 2 +- api/language/en-GB/install.xml | 2 +- api/language/en-GB/langmetadata.xml | 2 +- installation/language/en-GB/langmetadata.xml | 2 +- language/en-GB/install.xml | 2 +- language/en-GB/langmetadata.xml | 2 +- libraries/src/Toolbar/CoreButtonsTrait.php | 2 +- libraries/src/Toolbar/ToolbarHelper.php | 2 +- libraries/src/Version.php | 6 +++--- plugins/system/jooa11y/jooa11y.php | 12 ++++++------ .../components/com_media/MediaListCest.php | 4 ++-- 15 files changed, 24 insertions(+), 24 deletions(-) diff --git a/administrator/language/en-GB/install.xml b/administrator/language/en-GB/install.xml index 87c6747a74e56..c8659ad484aeb 100644 --- a/administrator/language/en-GB/install.xml +++ b/administrator/language/en-GB/install.xml @@ -3,7 +3,7 @@ English (en-GB) en-GB 4.1.0 - December 2021 + January 2022 Joomla! Project admin@joomla.org www.joomla.org diff --git a/administrator/language/en-GB/langmetadata.xml b/administrator/language/en-GB/langmetadata.xml index b96d1a7f24af8..2e8da753bf0a5 100644 --- a/administrator/language/en-GB/langmetadata.xml +++ b/administrator/language/en-GB/langmetadata.xml @@ -2,7 +2,7 @@ English (en-GB) 4.1.0 - December 2021 + January 2022 Joomla! Project admin@joomla.org www.joomla.org diff --git a/administrator/manifests/files/joomla.xml b/administrator/manifests/files/joomla.xml index caa01fe6e44a0..6c5a79c9b407e 100644 --- a/administrator/manifests/files/joomla.xml +++ b/administrator/manifests/files/joomla.xml @@ -6,8 +6,8 @@ www.joomla.org (C) 2019 Open Source Matters, Inc. GNU General Public License version 2 or later; see LICENSE.txt - 4.1.0-dev - December 2021 + 4.1.0-beta3 + January 2022 FILES_JOOMLA_XML_DESCRIPTION administrator/components/com_admin/script.php diff --git a/administrator/manifests/packages/pkg_en-GB.xml b/administrator/manifests/packages/pkg_en-GB.xml index 23e3134adce9c..a2d47e858cbda 100644 --- a/administrator/manifests/packages/pkg_en-GB.xml +++ b/administrator/manifests/packages/pkg_en-GB.xml @@ -3,7 +3,7 @@ English (en-GB) Language Pack en-GB 4.1.0.1 - December 2021 + January 2022 Joomla! Project admin@joomla.org www.joomla.org diff --git a/api/components/com_categories/src/Controller/CategoriesController.php b/api/components/com_categories/src/Controller/CategoriesController.php index 71ed5fae6007b..deff82f6438f9 100644 --- a/api/components/com_categories/src/Controller/CategoriesController.php +++ b/api/components/com_categories/src/Controller/CategoriesController.php @@ -65,7 +65,7 @@ protected function preprocessSaveData(array $data): array * * @return integer The record ID on success, false on failure * - * @since __DEPLOY_VERSION__ + * @since 4.1.0 */ protected function save($recordKey = null) { diff --git a/api/language/en-GB/install.xml b/api/language/en-GB/install.xml index 4a0ff0fa19e11..7a97416e4d1e9 100644 --- a/api/language/en-GB/install.xml +++ b/api/language/en-GB/install.xml @@ -3,7 +3,7 @@ English (en-GB) en-GB 4.1.0 - December 2021 + January 2022 Joomla! Project admin@joomla.org www.joomla.org diff --git a/api/language/en-GB/langmetadata.xml b/api/language/en-GB/langmetadata.xml index d334090823c7f..c71909c412579 100644 --- a/api/language/en-GB/langmetadata.xml +++ b/api/language/en-GB/langmetadata.xml @@ -2,7 +2,7 @@ English (en-GB) 4.1.0 - December 2021 + January 2022 Joomla! Project admin@joomla.org www.joomla.org diff --git a/installation/language/en-GB/langmetadata.xml b/installation/language/en-GB/langmetadata.xml index 640edc5e8092c..21e07f4bcc97b 100644 --- a/installation/language/en-GB/langmetadata.xml +++ b/installation/language/en-GB/langmetadata.xml @@ -2,7 +2,7 @@ English (United Kingdom) 4.1.0 - December 2021 + January 2022 Joomla! Project (C) 2005 Open Source Matters, Inc. GNU General Public License version 2 or later; see LICENSE.txt diff --git a/language/en-GB/install.xml b/language/en-GB/install.xml index acaf85d04586b..27af1b35c807d 100644 --- a/language/en-GB/install.xml +++ b/language/en-GB/install.xml @@ -3,7 +3,7 @@ English (en-GB) en-GB 4.1.0 - December 2021 + January 2022 Joomla! Project admin@joomla.org www.joomla.org diff --git a/language/en-GB/langmetadata.xml b/language/en-GB/langmetadata.xml index e8d2fd10c931a..8e7544db658db 100644 --- a/language/en-GB/langmetadata.xml +++ b/language/en-GB/langmetadata.xml @@ -2,7 +2,7 @@ English (en-GB) 4.1.0 - December 2021 + January 2022 Joomla! Project admin@joomla.org www.joomla.org diff --git a/libraries/src/Toolbar/CoreButtonsTrait.php b/libraries/src/Toolbar/CoreButtonsTrait.php index d35c8da3285c9..7ce4527babd3e 100644 --- a/libraries/src/Toolbar/CoreButtonsTrait.php +++ b/libraries/src/Toolbar/CoreButtonsTrait.php @@ -82,7 +82,7 @@ public function preview(string $url, string $text = 'JGLOBAL_PREVIEW', $newWindo * * @return PopupButton|LinkButton * - * @since __DEPLOY_VERSION__ + * @since 4.1.0 */ public function jooa11y(string $url, string $text = 'JGLOBAL_JOOA11Y', $newWindow = false) { diff --git a/libraries/src/Toolbar/ToolbarHelper.php b/libraries/src/Toolbar/ToolbarHelper.php index 0b17abe3525fa..bc17b7b04ed21 100644 --- a/libraries/src/Toolbar/ToolbarHelper.php +++ b/libraries/src/Toolbar/ToolbarHelper.php @@ -144,7 +144,7 @@ public static function preview($url = '', $updateEditors = false, $icon = 'previ * * @return void * - * @since __DEPLOY_VERSION__ + * @since 4.1.0 */ public static function jooa11y($url = '', $updateEditors = false, $icon = 'icon-universal-access', $bodyHeight = null, $modalWidth = null) { diff --git a/libraries/src/Version.php b/libraries/src/Version.php index d4cb5d7692efb..4fbd3215c6f17 100644 --- a/libraries/src/Version.php +++ b/libraries/src/Version.php @@ -61,7 +61,7 @@ final class Version * @var string * @since 3.8.0 */ - const EXTRA_VERSION = 'dev'; + const EXTRA_VERSION = 'beta3'; /** * Development status. @@ -69,7 +69,7 @@ final class Version * @var string * @since 3.5 */ - const DEV_STATUS = 'Development'; + const DEV_STATUS = 'Beta'; /** * Code name. @@ -85,7 +85,7 @@ final class Version * @var string * @since 3.5 */ - const RELDATE = '21-December-2021'; + const RELDATE = '4-January-2022'; /** * Release time. diff --git a/plugins/system/jooa11y/jooa11y.php b/plugins/system/jooa11y/jooa11y.php index 37dbea9a774ca..1953687e030e4 100644 --- a/plugins/system/jooa11y/jooa11y.php +++ b/plugins/system/jooa11y/jooa11y.php @@ -18,7 +18,7 @@ /** * Jooa11y plugin to add an accessibility checker * - * @since __DEPLOY_VERSION__ + * @since 4.1.0 */ class PlgSystemJooa11y extends CMSPlugin implements SubscriberInterface { @@ -26,7 +26,7 @@ class PlgSystemJooa11y extends CMSPlugin implements SubscriberInterface * Application object. * * @var CMSApplicationInterface - * @since __DEPLOY_VERSION__ + * @since 4.1.0 */ protected $app; @@ -34,7 +34,7 @@ class PlgSystemJooa11y extends CMSPlugin implements SubscriberInterface * Affects constructor behavior. If true, language files will be loaded automatically. * * @var boolean - * @since __DEPLOY_VERSION__ + * @since 4.1.0 */ protected $autoloadLanguage = true; @@ -43,7 +43,7 @@ class PlgSystemJooa11y extends CMSPlugin implements SubscriberInterface * * @return string[] An array of event mappings * - * @since __DEPLOY_VERSION__ + * @since 4.1.0 * * @throws Exception */ @@ -65,7 +65,7 @@ public static function getSubscribedEvents(): array * * @return boolean True if access is allowed. * - * @since __DEPLOY_VERSION__ + * @since 4.1.0 */ private function isAuthorisedDisplayChecker(): bool { @@ -101,7 +101,7 @@ private function isAuthorisedDisplayChecker(): bool * * @return void * - * @since __DEPLOY_VERSION__ + * @since 4.1.0 */ public function initJooa11y() { diff --git a/tests/Codeception/acceptance/administrator/components/com_media/MediaListCest.php b/tests/Codeception/acceptance/administrator/components/com_media/MediaListCest.php index df99920b86216..8da082d95fc3b 100644 --- a/tests/Codeception/acceptance/administrator/components/com_media/MediaListCest.php +++ b/tests/Codeception/acceptance/administrator/components/com_media/MediaListCest.php @@ -268,7 +268,7 @@ public function navigateUsingBreadcrumb(Media $I) * * @throws Exception * - * @since __DEPLOY_VERSION__ + * @since 4.1.0 */ public function searchInFilesAndFolders(Media $I) { @@ -288,7 +288,7 @@ public function searchInFilesAndFolders(Media $I) * * @throws Exception * - * @since __DEPLOY_VERSION__ + * @since 4.1.0 */ public function searchIsClearedOnNavigate(Media $I) { From fa1dad35d6ef2d789966002e897e7246cbd83c89 Mon Sep 17 00:00:00 2001 From: Benjamin Trenkle Date: Sun, 2 Jan 2022 01:03:32 +0100 Subject: [PATCH 02/28] Revert to dev --- administrator/manifests/files/joomla.xml | 2 +- libraries/src/Version.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/administrator/manifests/files/joomla.xml b/administrator/manifests/files/joomla.xml index 6c5a79c9b407e..77e57ae86ed26 100644 --- a/administrator/manifests/files/joomla.xml +++ b/administrator/manifests/files/joomla.xml @@ -6,7 +6,7 @@ www.joomla.org (C) 2019 Open Source Matters, Inc. GNU General Public License version 2 or later; see LICENSE.txt - 4.1.0-beta3 + 4.1.0-dev January 2022 FILES_JOOMLA_XML_DESCRIPTION diff --git a/libraries/src/Version.php b/libraries/src/Version.php index 4fbd3215c6f17..587909f470190 100644 --- a/libraries/src/Version.php +++ b/libraries/src/Version.php @@ -61,7 +61,7 @@ final class Version * @var string * @since 3.8.0 */ - const EXTRA_VERSION = 'beta3'; + const EXTRA_VERSION = 'dev'; /** * Development status. @@ -69,7 +69,7 @@ final class Version * @var string * @since 3.5 */ - const DEV_STATUS = 'Beta'; + const DEV_STATUS = 'Development'; /** * Code name. From d1e39d857414e072a22781907aa0bb3e1d53839b Mon Sep 17 00:00:00 2001 From: "Phil E. Taylor" Date: Tue, 4 Jan 2022 17:18:10 +0000 Subject: [PATCH 03/28] [4.1] Unused local variable 'doSearch'. The value of the variable is not used anywhere (#36380) --- api/components/com_media/src/Controller/MediaController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/components/com_media/src/Controller/MediaController.php b/api/components/com_media/src/Controller/MediaController.php index b9ed3e18023aa..a94ade2e02e03 100644 --- a/api/components/com_media/src/Controller/MediaController.php +++ b/api/components/com_media/src/Controller/MediaController.php @@ -130,7 +130,7 @@ public function displayList() $filter = InputFilter::getInstance(); // Search for files matching (part of) a name or glob pattern. - if ($doSearch = array_key_exists('search', $apiFilterInfo)) + if (\array_key_exists('search', $apiFilterInfo)) { $this->modelState->set('search', $filter->clean($apiFilterInfo['search'], 'STRING')); From 74a225ecddb3c4db82965b83833fc2625236fef1 Mon Sep 17 00:00:00 2001 From: Benjamin Trenkle Date: Wed, 5 Jan 2022 20:42:33 +0100 Subject: [PATCH 04/28] Update 4.1 from 4.0 (#36575) * [4.0] Backup message (#36487) Many users who use their hosts backup facility and this is typically __only__ for files This update reminds them to backup the database as well * [4.0] xml code style (#36532) Fixes a few spaces to tabs issues * [4.0] media manager breadcrumbs (#36154) * [4.0] media manager breadcrumbs The RTL specific css was wrong as can be seen in the before screenshot This PR removes the RTL specific css (should have been scss) and updates the scss to use logical properties instead. This PR also removes an unused class `breadcrumb-item`. To test RTL you will need to install arabic or persian. and dont forget to npm ci There is no visible change in LTR and the RTL changes are as shown below ## Before LTR ## Before RTL ## After LTR ## After RTL * revert * [4.0] RTL: Correcting Admin login 2factor and feedback hints (#36024) This is a replacement to the merged PR #32104 It does exactly the same thing but by using css logical properties we avoid the need to maintain both an LTR and an RTL version[4.0] There is no visual change * [4.0] Category list (#36536) Remove extra div that is not needed * [4.0] Make routing work in console applications (#36332) * Update list-fancy-select.php (#36543) replace tab with space code review * [4.0] archive icon (#36263) All the state icons are grey so that the published icon, which is green, stands out visually. The archived icon however was black. This PR changes that icon to grey. ### Before ### After * [4.0] Banner Client tips (#36262) * [4.0] Banner Client tips Adds a tooltip to the banner client numbers so that they appear the same as category numbers. Also corrects the class on the trashed number so that it has the correct colour To test Create one banner client Create a banner for the client in each of the published states * Update administrator/components/com_banners/tmpl/clients/default.php oops Co-authored-by: Quy Co-authored-by: Quy * Fix article creation from frontend (#36542) * [4.0] Handle when toggle icon is not available (#36329) * Handle when toggle icon is not available * cs * Take workflow extension into account when setting a default (#36527) * Fix uploadlimits checks (#36023) * Make edit_lock layout reusable for other extensions (#35112) * Allow to set a value for SubformField (#35921) * [4.0] Fix example in cleanImageURL docblock (#36554) * Fix Codemirror behind tabs (#36140) * Fix Codemirror behind tabs * jscs * Remove dependency on Factory in AdminController * [4.0] Ensure path contains api in the router (#36315) * [4.0] Check model is set before calling its methods (#36378) * Check model is set before calling its methods * Update OverridesController.php * Category edit form should use return url (#36560) Currently the article edit form respects return URLs; the category edit form does not. Adding it here makes for a more consistent editing experience. * [4.0] Sample Data plugin images (#36237) Updates the plugin to use the new image data used in lazy loading etc. This avoids confusion for users who see different source code for their created articles when compared to the same data plugins To test. Just make sure the sample data still installs and works as expected * [4.0] If the Mail Template was not found in the db, return false (#36489) * [4.0] Code Style (#36564) * Use an absolute path in image list field (#36063) * Correct Cache setWorkarounds to take account of multiple script or style declarations being used that mean that we have an array of scripts or stylesheets to be cached and not just a string (#36068) Cache setWorkarounds returns an array not a string Co-authored-by: Brian Teeman Co-authored-by: Allon Moritz Co-authored-by: Quy Co-authored-by: Nicola Galgano Co-authored-by: Roland Dalmulder Co-authored-by: Harald Leithner Co-authored-by: Tuan Pham Ngoc Co-authored-by: Fedir Zinchuk Co-authored-by: wilsonge Co-authored-by: Phil E. Taylor Co-authored-by: Crystal Dionysopoulos <9141288+crystalenka@users.noreply.github.com> Co-authored-by: heelc29 <66922325+heelc29@users.noreply.github.com> Co-authored-by: Geraint Edwards --- .../com_banners/tmpl/clients/default.php | 36 ++++++-- .../com_categories/tmpl/category/edit.php | 1 + .../components/com_content/forms/article.xml | 2 +- .../com_content/src/Model/ArticleModel.php | 4 +- .../com_installer/src/Model/WarningsModel.php | 85 ++++++++++++------- .../src/Controller/ApiController.php | 22 +++-- .../components/com_menus/forms/item.xml | 2 +- .../src/Controller/ItemsController.php | 2 +- .../src/Controller/StagesController.php | 2 +- .../src/Controller/WorkflowsController.php | 2 +- .../com_workflow/src/Model/WorkflowModel.php | 7 +- .../com_workflow/src/Table/WorkflowTable.php | 13 ++- .../language/en-GB/com_joomlaupdate.ini | 2 +- .../src/Controller/OverridesController.php | 6 +- .../scss/components/_media-breadcrumb.scss | 52 +++--------- .../js/joomla-editor-codemirror.w-c.es6.js | 13 +++ .../plg_editors_tinymce/js/tinymce.es6.js | 6 +- .../atum/scss/blocks/_icons.scss | 1 - .../atum/scss/blocks/_login.scss | 20 +---- layouts/joomla/content/category_default.php | 81 +++++++++--------- layouts/joomla/content/icons/edit_lock.php | 13 +-- .../joomla/form/field/list-fancy-select.php | 2 +- .../src/Application/ConsoleApplication.php | 26 ++++++ libraries/src/Cache/Cache.php | 10 ++- libraries/src/Form/Field/SubformField.php | 11 +++ libraries/src/HTML/HTMLHelper.php | 10 ++- .../src/MVC/Controller/AdminController.php | 3 +- libraries/src/Mail/MailTemplate.php | 8 +- libraries/src/Uri/Uri.php | 12 +-- plugins/fields/imagelist/tmpl/imagelist.php | 4 +- plugins/sampledata/blog/blog.php | 40 ++++++--- 31 files changed, 295 insertions(+), 203 deletions(-) diff --git a/administrator/components/com_banners/tmpl/clients/default.php b/administrator/components/com_banners/tmpl/clients/default.php index 27f0d737f6a44..fc7e5392d1479 100644 --- a/administrator/components/com_banners/tmpl/clients/default.php +++ b/administrator/components/com_banners/tmpl/clients/default.php @@ -123,20 +123,40 @@ contact; ?> - - count_published; ?> + + count_published; ?> + + - - count_unpublished; ?> + + count_unpublished; ?> + + - - count_archived; ?> + + count_archived; ?> + + - - count_trashed; ?> + + count_trashed; ?> + + purchase_type < 0) : ?> diff --git a/administrator/components/com_categories/tmpl/category/edit.php b/administrator/components/com_categories/tmpl/category/edit.php index 26dfa454f4ac8..448b4a18d5832 100644 --- a/administrator/components/com_categories/tmpl/category/edit.php +++ b/administrator/components/com_categories/tmpl/category/edit.php @@ -124,6 +124,7 @@ form->getInput('extension'); ?> + diff --git a/administrator/components/com_content/forms/article.xml b/administrator/components/com_content/forms/article.xml index a71ec8438528c..6c9189d19404f 100644 --- a/administrator/components/com_content/forms/article.xml +++ b/administrator/components/com_content/forms/article.xml @@ -909,7 +909,7 @@
+ label="JGLOBAL_FIELDSET_METADATA_OPTIONS"> input->getInt('a_id') ?: $app->input->getInt('id', 0); + $articleIdFromInput = $app->isClient('site') + ? $app->input->getInt('a_id', 0) + : $app->input->getInt('id', 0); // On edit article, we get ID of article from article.id state, but on save, we use data from input $id = (int) $this->getState('article.id', $articleIdFromInput); diff --git a/administrator/components/com_installer/src/Model/WarningsModel.php b/administrator/components/com_installer/src/Model/WarningsModel.php index 395add43e35ad..ff3d20e5d1ce5 100644 --- a/administrator/components/com_installer/src/Model/WarningsModel.php +++ b/administrator/components/com_installer/src/Model/WarningsModel.php @@ -98,76 +98,99 @@ public function getItems() $messages = []; // 16MB - $minMemory = 16 * 1024 * 1024; + $minLimit = 16 * 1024 * 1024; $file_uploads = ini_get('file_uploads'); if (!$file_uploads) { - $messages[] = array('message' => Text::_('COM_INSTALLER_MSG_WARNINGS_FILEUPLOADSDISABLED'), - 'description' => Text::_('COM_INSTALLER_MSG_WARNINGS_FILEUPLOADISDISABLEDDESC')); + $messages[] = [ + 'message' => Text::_('COM_INSTALLER_MSG_WARNINGS_FILEUPLOADSDISABLED'), + 'description' => Text::_('COM_INSTALLER_MSG_WARNINGS_FILEUPLOADISDISABLEDDESC'), + ]; } $upload_dir = ini_get('upload_tmp_dir'); if (!$upload_dir) { - $messages[] = array('message' => Text::_('COM_INSTALLER_MSG_WARNINGS_PHPUPLOADNOTSET'), - 'description' => Text::_('COM_INSTALLER_MSG_WARNINGS_PHPUPLOADNOTSETDESC')); + $messages[] = [ + 'message' => Text::_('COM_INSTALLER_MSG_WARNINGS_PHPUPLOADNOTSET'), + 'description' => Text::_('COM_INSTALLER_MSG_WARNINGS_PHPUPLOADNOTSETDESC'), + ]; } elseif (!is_writable($upload_dir)) { - $messages[] = array('message' => Text::_('COM_INSTALLER_MSG_WARNINGS_PHPUPLOADNOTWRITEABLE'), - 'description' => Text::sprintf('COM_INSTALLER_MSG_WARNINGS_PHPUPLOADNOTWRITEABLEDESC', $upload_dir)); + $messages[] = [ + 'message' => Text::_('COM_INSTALLER_MSG_WARNINGS_PHPUPLOADNOTWRITEABLE'), + 'description' => Text::sprintf('COM_INSTALLER_MSG_WARNINGS_PHPUPLOADNOTWRITEABLEDESC', $upload_dir), + ]; } $tmp_path = Factory::getApplication()->get('tmp_path'); if (!$tmp_path) { - $messages[] = array('message' => Text::_('COM_INSTALLER_MSG_WARNINGS_JOOMLATMPNOTSET'), - 'description' => Text::_('COM_INSTALLER_MSG_WARNINGS_JOOMLATMPNOTSETDESC')); + $messages[] = [ + 'message' => Text::_('COM_INSTALLER_MSG_WARNINGS_JOOMLATMPNOTSET'), + 'description' => Text::_('COM_INSTALLER_MSG_WARNINGS_JOOMLATMPNOTSETDESC'), + ]; } elseif (!is_writable($tmp_path)) { - $messages[] = array('message' => Text::_('COM_INSTALLER_MSG_WARNINGS_JOOMLATMPNOTWRITEABLE'), - 'description' => Text::sprintf('COM_INSTALLER_MSG_WARNINGS_JOOMLATMPNOTWRITEABLEDESC', $tmp_path)); + $messages[] = [ + 'message' => Text::_('COM_INSTALLER_MSG_WARNINGS_JOOMLATMPNOTWRITEABLE'), + 'description' => Text::sprintf('COM_INSTALLER_MSG_WARNINGS_JOOMLATMPNOTWRITEABLEDESC', $tmp_path), + ]; } $memory_limit = $this->return_bytes(ini_get('memory_limit')); - if ($memory_limit < $minMemory && $memory_limit != -1) + if ($memory_limit > -1) { - // 16MB - $messages[] = array('message' => Text::_('COM_INSTALLER_MSG_WARNINGS_LOWMEMORYWARN'), - 'description' => Text::_('COM_INSTALLER_MSG_WARNINGS_LOWMEMORYDESC')); - } - elseif ($memory_limit < ($minMemory * 1.5) && $memory_limit != -1) - { - // 24MB - $messages[] = array('message' => Text::_('COM_INSTALLER_MSG_WARNINGS_MEDMEMORYWARN'), - 'description' => Text::_('COM_INSTALLER_MSG_WARNINGS_MEDMEMORYDESC')); + if ($memory_limit < $minLimit) + { + // 16MB + $messages[] = [ + 'message' => Text::_('COM_INSTALLER_MSG_WARNINGS_LOWMEMORYWARN'), + 'description' => Text::_('COM_INSTALLER_MSG_WARNINGS_LOWMEMORYDESC'), + ]; + } + elseif ($memory_limit < ($minLimit * 1.5)) + { + // 24MB + $messages[] = [ + 'message' => Text::_('COM_INSTALLER_MSG_WARNINGS_MEDMEMORYWARN'), + 'description' => Text::_('COM_INSTALLER_MSG_WARNINGS_MEDMEMORYDESC'), + ]; + } } - $post_max_size = $this->return_bytes(ini_get('post_max_size')); + $post_max_size = $this->return_bytes(ini_get('post_max_size')); $upload_max_filesize = $this->return_bytes(ini_get('upload_max_filesize')); - if ($post_max_size < $upload_max_filesize) + if ($post_max_size > 0 && $post_max_size < $upload_max_filesize) { - $messages[] = array('message' => Text::_('COM_INSTALLER_MSG_WARNINGS_UPLOADBIGGERTHANPOST'), - 'description' => Text::_('COM_INSTALLER_MSG_WARNINGS_UPLOADBIGGERTHANPOSTDESC')); + $messages[] = [ + 'message' => Text::_('COM_INSTALLER_MSG_WARNINGS_UPLOADBIGGERTHANPOST'), + 'description' => Text::_('COM_INSTALLER_MSG_WARNINGS_UPLOADBIGGERTHANPOSTDESC'), + ]; } - if ($post_max_size < $minMemory) + if ($post_max_size > 0 && $post_max_size < $minLimit) { - $messages[] = array('message' => Text::_('COM_INSTALLER_MSG_WARNINGS_SMALLPOSTSIZE'), - 'description' => Text::_('COM_INSTALLER_MSG_WARNINGS_SMALLPOSTSIZEDESC')); + $messages[] = [ + 'message' => Text::_('COM_INSTALLER_MSG_WARNINGS_SMALLPOSTSIZE'), + 'description' => Text::_('COM_INSTALLER_MSG_WARNINGS_SMALLPOSTSIZEDESC'), + ]; } - if ($upload_max_filesize < $minMemory) + if ($upload_max_filesize > 0 && $upload_max_filesize < $minLimit) { - $messages[] = array('message' => Text::_('COM_INSTALLER_MSG_WARNINGS_SMALLUPLOADSIZE'), - 'description' => Text::_('COM_INSTALLER_MSG_WARNINGS_SMALLUPLOADSIZEDESC')); + $messages[] = [ + 'message' => Text::_('COM_INSTALLER_MSG_WARNINGS_SMALLUPLOADSIZE'), + 'description' => Text::_('COM_INSTALLER_MSG_WARNINGS_SMALLUPLOADSIZEDESC'), + ]; } return $messages; diff --git a/administrator/components/com_media/src/Controller/ApiController.php b/administrator/components/com_media/src/Controller/ApiController.php index ff9568617f998..3fab0b90b5b79 100644 --- a/administrator/components/com_media/src/Controller/ApiController.php +++ b/administrator/components/com_media/src/Controller/ApiController.php @@ -359,15 +359,19 @@ public function getModel($name = 'Api', $prefix = 'Administrator', $config = []) */ private function checkContent() { - $params = ComponentHelper::getParams('com_media'); - - $helper = new MediaHelper; - $serverlength = $this->input->server->getInt('CONTENT_LENGTH'); - - if (($params->get('upload_maxsize', 0) > 0 && $serverlength > ($params->get('upload_maxsize', 0) * 1024 * 1024)) - || $serverlength > $helper->toBytes(ini_get('upload_max_filesize')) - || $serverlength > $helper->toBytes(ini_get('post_max_size')) - || $serverlength > $helper->toBytes(ini_get('memory_limit'))) + $helper = new MediaHelper; + $contentLength = $this->input->server->getInt('CONTENT_LENGTH'); + $params = ComponentHelper::getParams('com_media'); + $paramsUploadMaxsize = $params->get('upload_maxsize', 0) * 1024 * 1024; + $uploadMaxFilesize = $helper->toBytes(ini_get('upload_max_filesize')); + $postMaxSize = $helper->toBytes(ini_get('post_max_size')); + $memoryLimit = $helper->toBytes(ini_get('memory_limit')); + + if (($paramsUploadMaxsize > 0 && $contentLength > $paramsUploadMaxsize) + || ($uploadMaxFilesize > 0 && $contentLength > $uploadMaxFilesize) + || ($postMaxSize > 0 && $contentLength > $postMaxSize) + || ($memoryLimit > -1 && $contentLength > $memoryLimit) + ) { throw new \Exception(Text::_('COM_MEDIA_ERROR_WARNFILETOOLARGE'), 403); } diff --git a/administrator/components/com_menus/forms/item.xml b/administrator/components/com_menus/forms/item.xml index db0570dc2c2ef..984ae531e0d57 100644 --- a/administrator/components/com_menus/forms/item.xml +++ b/administrator/components/com_menus/forms/item.xml @@ -97,7 +97,7 @@ showtime="true" size="22" filter="user_utc" - showon="home:0" + showon="home:0" /> registerTask('unsetDefault', 'setDefault'); + $this->registerTask('unsetDefault', 'setDefault'); } /** diff --git a/administrator/components/com_workflow/src/Controller/StagesController.php b/administrator/components/com_workflow/src/Controller/StagesController.php index 5cd19a2fb7e50..e7af94b3b2372 100644 --- a/administrator/components/com_workflow/src/Controller/StagesController.php +++ b/administrator/components/com_workflow/src/Controller/StagesController.php @@ -103,7 +103,7 @@ public function __construct(array $config = array(), MVCFactoryInterface $factor } } - $this->registerTask('unsetDefault', 'setDefault'); + $this->registerTask('unsetDefault', 'setDefault'); } /** diff --git a/administrator/components/com_workflow/src/Controller/WorkflowsController.php b/administrator/components/com_workflow/src/Controller/WorkflowsController.php index 9c698600ff0ae..9739d666dba2c 100644 --- a/administrator/components/com_workflow/src/Controller/WorkflowsController.php +++ b/administrator/components/com_workflow/src/Controller/WorkflowsController.php @@ -76,7 +76,7 @@ public function __construct($config = array(), MVCFactoryInterface $factory = nu } } - $this->registerTask('unsetDefault', 'setDefault'); + $this->registerTask('unsetDefault', 'setDefault'); } /** diff --git a/administrator/components/com_workflow/src/Model/WorkflowModel.php b/administrator/components/com_workflow/src/Model/WorkflowModel.php index beb71976e59d2..dec07533ed127 100644 --- a/administrator/components/com_workflow/src/Model/WorkflowModel.php +++ b/administrator/components/com_workflow/src/Model/WorkflowModel.php @@ -297,7 +297,12 @@ public function setDefault($pk, $value = 1) if ($value) { // Unset other default item - if ($table->load(array('default' => '1'))) + if ($table->load( + [ + 'default' => '1', + 'extension' => $table->get('extension') + ] + )) { $table->default = 0; $table->modified = $date; diff --git a/administrator/components/com_workflow/src/Table/WorkflowTable.php b/administrator/components/com_workflow/src/Table/WorkflowTable.php index faedf915b6f12..a9f7267bb39b7 100644 --- a/administrator/components/com_workflow/src/Table/WorkflowTable.php +++ b/administrator/components/com_workflow/src/Table/WorkflowTable.php @@ -144,7 +144,7 @@ public function check() } else { - $db = $this->getDbo(); + $db = $this->getDbo(); $query = $db->getQuery(true); $query @@ -192,7 +192,7 @@ public function store($updateNulls = true) { // Existing item $this->modified_by = $user->id; - $this->modified = $date->toSql(); + $this->modified = $date->toSql(); } else { @@ -219,10 +219,15 @@ public function store($updateNulls = true) $this->modified_by = $this->created_by; } - if ($this->default == '1') + if ((int) $this->default === 1) { // Verify that the default is unique for this workflow - if ($table->load(array('default' => '1'))) + if ($table->load( + [ + 'default' => '1', + 'extension' => $this->extension + ] + )) { $table->default = 0; $table->store(); diff --git a/administrator/language/en-GB/com_joomlaupdate.ini b/administrator/language/en-GB/com_joomlaupdate.ini index 06aecff2d5b28..b2dd8d7fabb0a 100644 --- a/administrator/language/en-GB/com_joomlaupdate.ini +++ b/administrator/language/en-GB/com_joomlaupdate.ini @@ -59,7 +59,7 @@ COM_JOOMLAUPDATE_SELF_EMPTYSTATE_TITLE="A new version of the Joomla Update Compo COM_JOOMLAUPDATE_SYSTEM_CHECK="System Check" COM_JOOMLAUPDATE_TOOLBAR_CHECK="Check for Updates" COM_JOOMLAUPDATE_UPDATE_CHECK="Update Check" -COM_JOOMLAUPDATE_UPDATE_CONFIRM_BACKUP="I'm prepared for the update and have made a backup." +COM_JOOMLAUPDATE_UPDATE_CONFIRM_BACKUP="I'm prepared for the update and have made a backup of the files and database." COM_JOOMLAUPDATE_UPDATE_EMPTYSTATE_TITLE="Update your site to \"Joomla! %s\"" COM_JOOMLAUPDATE_UPDATE_EMPTYSTATE_BUTTON_ADD="Start update" COM_JOOMLAUPDATE_UPDATE_LOG_CLEANUP="Cleaning up after installation." diff --git a/api/components/com_languages/src/Controller/OverridesController.php b/api/components/com_languages/src/Controller/OverridesController.php index 9ebb27ff5db9c..fc376fbe2e3bb 100644 --- a/api/components/com_languages/src/Controller/OverridesController.php +++ b/api/components/com_languages/src/Controller/OverridesController.php @@ -87,14 +87,14 @@ protected function save($recordKey = null) /** @var \Joomla\CMS\MVC\Model\AdminModel $model */ $model = $this->getModel(Inflector::singularize($this->contentType)); - $model->setState('filter.language', $this->input->post->get('lang_code')); - $model->setState('filter.client', $this->input->post->get('app')); - if (!$model) { throw new \RuntimeException(Text::_('JLIB_APPLICATION_ERROR_MODEL_CREATE')); } + $model->setState('filter.language', $this->input->post->get('lang_code')); + $model->setState('filter.client', $this->input->post->get('app')); + $data = $this->input->get('data', json_decode($this->input->json->getRaw(), true), 'array'); // TODO: Not the cleanest thing ever but it works... diff --git a/build/media_source/com_media/scss/components/_media-breadcrumb.scss b/build/media_source/com_media/scss/components/_media-breadcrumb.scss index 21fdc086d519a..faffa71558c62 100644 --- a/build/media_source/com_media/scss/components/_media-breadcrumb.scss +++ b/build/media_source/com_media/scss/components/_media-breadcrumb.scss @@ -1,11 +1,11 @@ .media-breadcrumb { display: flex; padding: 0; - margin: 0 auto 0 0; + margin-inline-end: auto; font-size: .9rem; line-height: $toolbar-height; background: transparent; - border-left: 1px solid $border-color; + border-inline-start: 1px solid $border-color; ol { display: flex; @@ -20,15 +20,16 @@ } .media-breadcrumb-item { - padding: 0 8px 0 22px; + padding-inline-end: 8px; + padding-inline-start: 22px; background-color: $breadcrumbs-bg; &:first-of-type { - padding-left: 16px; + padding-inline-start: 16px; } &:last-of-type { background-color: $breadcrumbs-current-bg; &::after { - border-left-color: $breadcrumbs-current-bg; + border-inline-start-color: $breadcrumbs-current-bg; } } &:hover { @@ -42,7 +43,7 @@ position: absolute; top: 0; bottom: 0; - left: 100%; + inset-inline-start: 100%; z-index: 2; display: block; width: 0; @@ -51,45 +52,12 @@ content: "" !important; border-top: 23px solid transparent; border-bottom: 23px solid transparent; - border-left: 10px solid transparent; + border-inline-start: 10px solid transparent; } &::before { - border-left-color: $border-color; + border-inline-start-color: $border-color; } &::after { - border-left-color: $breadcrumbs-bg; + border-inline-start-color: $breadcrumbs-bg; } } - -.breadcrumb-item + .breadcrumb-item::before { - display: none; -} - -// RTL override - -html[dir=rtl] .media-breadcrumb { - margin: 0 0 0 auto; -} - -html[dir=rtl] .media-breadcrumb-item::after, .media-breadcrumb-item::before { - right: 100%; - border-right: 10px solid transparent; - border-left: 0; -} - -html[dir=rtl] .media-breadcrumb-item { - padding: 0 22px 0 8px; -} - -html[dir=rtl] .media-breadcrumb-item::before { - border-right-color: #fafafa; -} - -html[dir=rtl] .media-breadcrumb-item:first-of-type { - padding-right: 16px; - padding-left: 0; -} - -html[dir=rtl] .media-breadcrumb-item:last-of-type::after { - border-right: 10px solid #fff; -} diff --git a/build/media_source/plg_editors_codemirror/js/joomla-editor-codemirror.w-c.es6.js b/build/media_source/plg_editors_codemirror/js/joomla-editor-codemirror.w-c.es6.js index ecef691e569ec..ddb2ded4c2331 100644 --- a/build/media_source/plg_editors_codemirror/js/joomla-editor-codemirror.w-c.es6.js +++ b/build/media_source/plg_editors_codemirror/js/joomla-editor-codemirror.w-c.es6.js @@ -6,6 +6,13 @@ class CodemirrorEditor extends HTMLElement { this.host = window.location.origin; this.element = this.querySelector('textarea'); this.refresh = this.refresh.bind(this); + + // Observer instance to refresh the Editor when it become visible, eg after Tab switching + this.intersectionObserver = new IntersectionObserver((entries) => { + if (entries[0].isIntersecting && this.instance) { + this.instance.refresh(); + } + }, { threshold: 0 }); } static get observedAttributes() { @@ -124,11 +131,17 @@ class CodemirrorEditor extends HTMLElement { this.instance = window.CodeMirror.fromTextArea(this.element, this.options); this.instance.disable = (disabled) => this.setOption('readOnly', disabled ? 'nocursor' : false); Joomla.editors.instances[this.element.id] = this.instance; + + // Watch when the element in viewport, and refresh the editor + this.intersectionObserver.observe(this); } disconnectedCallback() { // Remove from the Joomla API delete Joomla.editors.instances[this.element.id]; + + // Remove from observer + this.intersectionObserver.unobserve(this); } refresh(element) { diff --git a/build/media_source/plg_editors_tinymce/js/tinymce.es6.js b/build/media_source/plg_editors_tinymce/js/tinymce.es6.js index 795dc92d7f13b..aad5d4592ef9b 100644 --- a/build/media_source/plg_editors_tinymce/js/tinymce.es6.js +++ b/build/media_source/plg_editors_tinymce/js/tinymce.es6.js @@ -33,12 +33,14 @@ toggleButton.removeAttribute('disabled'); toggleButton.addEventListener('click', () => { if (Joomla.editors.instances[currentEditor.id].instance.isHidden()) { - toggleIcon.setAttribute('class', 'icon-eye'); Joomla.editors.instances[currentEditor.id].instance.show(); } else { - toggleIcon.setAttribute('class', 'icon-eye-slash'); Joomla.editors.instances[currentEditor.id].instance.hide(); } + + if (toggleIcon) { + toggleIcon.setAttribute('class', Joomla.editors.instances[currentEditor.id].instance.isHidden() ? 'icon-eye' : 'icon-eye-slash'); + } }); } }); diff --git a/build/media_source/templates/administrator/atum/scss/blocks/_icons.scss b/build/media_source/templates/administrator/atum/scss/blocks/_icons.scss index 671ac513c78b5..5528b46ec864a 100644 --- a/build/media_source/templates/administrator/atum/scss/blocks/_icons.scss +++ b/build/media_source/templates/administrator/atum/scss/blocks/_icons.scss @@ -38,7 +38,6 @@ border-color: $warning; } - .#{$jicon-css-prefix}-archive, .#{$jicon-css-prefix}-folder, .#{$fa-css-prefix}-folder { color: var(--template-text-dark); diff --git a/build/media_source/templates/administrator/atum/scss/blocks/_login.scss b/build/media_source/templates/administrator/atum/scss/blocks/_login.scss index 08a068b30771f..dd28e05015eb1 100644 --- a/build/media_source/templates/administrator/atum/scss/blocks/_login.scss +++ b/build/media_source/templates/administrator/atum/scss/blocks/_login.scss @@ -84,30 +84,18 @@ .form-control-feedback { position: absolute; - right: 0; + inset-inline-end: 0; bottom: -1.5rem; font-size: ($font-size-base * .75); - text-align: right; - - [dir=rtl] & { - right: auto; - left: 0; - text-align: left; - } + text-align: end; } .form-control-hint { position: absolute; top: .1rem; - right: 0; + inset-inline-end: 0; font-size: ($font-size-base * .75); - text-align: right; - - [dir=rtl] & { - right: auto; - left: 0; - text-align: left; - } + text-align: end; } } diff --git a/layouts/joomla/content/category_default.php b/layouts/joomla/content/category_default.php index 0b5b36ea4bc28..5ba6d8ea049ec 100644 --- a/layouts/joomla/content/category_default.php +++ b/layouts/joomla/content/category_default.php @@ -51,50 +51,47 @@ $tagsData = $category->tags->itemTags; ?> -
-
- get('show_page_heading')) : ?> -

- escape($params->get('page_heading')); ?> -

- +
+ get('show_page_heading')) : ?> +

+ escape($params->get('page_heading')); ?> +

+ - get('show_category_title', 1)) : ?> - <> - title, '', $extension . '.category.title'); ?> - > - - + get('show_category_title', 1)) : ?> + <> + title, '', $extension . '.category.title'); ?> + > + + - get('show_cat_tags', 1)) : ?> - - + get('show_cat_tags', 1)) : ?> + + - get('show_description', 1) || $params->def('show_description_image', 1)) : ?> -
- get('show_description_image') && $category->getParams()->get('image')) : ?> - getParams()->get('image_alt')) && empty($category->getParams()->get('image_alt_empty')) ? '' : 'alt="' . htmlspecialchars($category->getParams()->get('image_alt'), ENT_COMPAT, 'UTF-8') . '"'; ?> - > - - - get('show_description') && $category->description) : ?> - description, '', $extension . '.category.description'); ?> - - -
- - loadTemplate($displayData->subtemplatename); ?> + get('show_description', 1) || $params->def('show_description_image', 1)) : ?> +
+ get('show_description_image') && $category->getParams()->get('image')) : ?> + getParams()->get('image_alt')) && empty($category->getParams()->get('image_alt_empty')) ? '' : 'alt="' . htmlspecialchars($category->getParams()->get('image_alt'), ENT_COMPAT, 'UTF-8') . '"'; ?> + > + + + get('show_description') && $category->description) : ?> + description, '', $extension . '.category.description'); ?> + + +
+ + loadTemplate($displayData->subtemplatename); ?> - maxLevel != 0 && $displayData->get('children')) : ?> -
- get('show_category_heading_title_text', 1) == 1) : ?> -

- -

- - loadTemplate('children'); ?> -
- -
+ maxLevel != 0 && $displayData->get('children')) : ?> +
+ get('show_category_heading_title_text', 1) == 1) : ?> +

+ +

+ + loadTemplate('children'); ?> +
+
- diff --git a/layouts/joomla/content/icons/edit_lock.php b/layouts/joomla/content/icons/edit_lock.php index e22160aa5055d..3b8def519104c 100644 --- a/layouts/joomla/content/icons/edit_lock.php +++ b/layouts/joomla/content/icons/edit_lock.php @@ -11,15 +11,18 @@ use Joomla\CMS\Language\Text; -if (isset($displayData['article'])) +if (isset($displayData['ariaDescribed'])) { - $article = $displayData['article']; + $aria_described = $displayData['ariaDescribed']; +} +elseif (isset($displayData['article'])) +{ + $article = $displayData['article']; $aria_described = 'editarticle-' . (int) $article->id; } - -if (isset($displayData['contact'])) +elseif (isset($displayData['contact'])) { - $contact = $displayData['contact']; + $contact = $displayData['contact']; $aria_described = 'editcontact-' . (int) $contact->id; } diff --git a/layouts/joomla/form/field/list-fancy-select.php b/layouts/joomla/form/field/list-fancy-select.php index ed97de16f4aa3..8820fe0fee473 100644 --- a/layouts/joomla/form/field/list-fancy-select.php +++ b/layouts/joomla/form/field/list-fancy-select.php @@ -110,4 +110,4 @@ ?> -> +> diff --git a/libraries/src/Application/ConsoleApplication.php b/libraries/src/Application/ConsoleApplication.php index 391d00a8ec691..8b218c56a26a4 100644 --- a/libraries/src/Application/ConsoleApplication.php +++ b/libraries/src/Application/ConsoleApplication.php @@ -10,10 +10,13 @@ \defined('JPATH_PLATFORM') or die; +use InvalidArgumentException; use Joomla\CMS\Console; use Joomla\CMS\Extension\ExtensionManagerTrait; +use Joomla\CMS\Factory; use Joomla\CMS\Language\Language; use Joomla\CMS\Plugin\PluginHelper; +use Joomla\CMS\Router\Router; use Joomla\CMS\Version; use Joomla\Console\Application; use Joomla\DI\Container; @@ -434,4 +437,27 @@ public function setName(string $name): void { throw new \RuntimeException('The console application name cannot be changed'); } + + /** + * Returns the application Router object. + * + * @param string $name The name of the application. + * @param array $options An optional associative array of configuration settings. + * + * @return Router + * + * @since __DEPLOY_VERSION__ + * @throws \InvalidArgumentException + */ + public static function getRouter($name = null, array $options = array()) + { + if (empty($name)) + { + throw new InvalidArgumentException('A router name must be set in console application.'); + } + + $options['mode'] = Factory::getApplication()->get('sef'); + + return Router::getInstance($name, $options); + } } diff --git a/libraries/src/Cache/Cache.php b/libraries/src/Cache/Cache.php index 9bc636965ad42..4d3693cd8b08c 100644 --- a/libraries/src/Cache/Cache.php +++ b/libraries/src/Cache/Cache.php @@ -595,7 +595,7 @@ public static function getWorkarounds($data, $options = array()) * @param string $data Cached data * @param array $options Array of options * - * @return array + * @return array Data to be cached * * @since 1.7.0 */ @@ -688,9 +688,13 @@ public static function setWorkarounds($data, $options = []) { $oldScriptStr = $options['headerbefore'][$now][strtolower($type)]; - if ($oldScriptStr != $currentScriptStr) + // Save only the appended declaration. + if (\is_array($oldScriptStr) && \is_array($currentScriptStr)) + { + $newvalue[strtolower($type)] = array_diff_key($currentScriptStr, $oldScriptStr); + } + else { - // Save only the appended declaration. $newvalue[strtolower($type)] = StringHelper::substr($currentScriptStr, StringHelper::strlen($oldScriptStr)); } } diff --git a/libraries/src/Form/Field/SubformField.php b/libraries/src/Form/Field/SubformField.php index 867a4cd8be5c9..c477f34c52dcf 100644 --- a/libraries/src/Form/Field/SubformField.php +++ b/libraries/src/Form/Field/SubformField.php @@ -173,6 +173,17 @@ public function __set($name, $value) break; + case 'value': + // We allow a json encoded string or an array + if (is_string($value)) + { + $value = json_decode($value, true); + } + + $this->value = $value !== null ? (array) $value : null; + + break; + default: parent::__set($name, $value); } diff --git a/libraries/src/HTML/HTMLHelper.php b/libraries/src/HTML/HTMLHelper.php index b09bda11ad0eb..b538febff82ef 100644 --- a/libraries/src/HTML/HTMLHelper.php +++ b/libraries/src/HTML/HTMLHelper.php @@ -632,13 +632,15 @@ protected static function includeRelativeFiles($folder, $file, $relative, $detec /** * Gets a URL, cleans the Joomla specific params and returns an object * - * @param string $url The relative or absolute URL to use for the src attribute. + * @param string $url The relative or absolute URL to use for the src attribute. * * @return object * @example { - * url: 'string', - * width: integer, - * height: integer, + * url: 'string', + * attributes: [ + * width: integer, + * height: integer, + * ] * } * * @since 4.0.0 diff --git a/libraries/src/MVC/Controller/AdminController.php b/libraries/src/MVC/Controller/AdminController.php index 11ae6242cec86..6f455f220a3c1 100644 --- a/libraries/src/MVC/Controller/AdminController.php +++ b/libraries/src/MVC/Controller/AdminController.php @@ -12,7 +12,6 @@ use Joomla\CMS\Application\CMSApplication; use Joomla\CMS\Component\ComponentHelper; -use Joomla\CMS\Factory; use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Factory\MVCFactoryInterface; use Joomla\CMS\MVC\Model\BaseDatabaseModel; @@ -224,7 +223,7 @@ public function publish() { if ($errors) { - Factory::getApplication()->enqueueMessage(Text::plural($this->text_prefix . '_N_ITEMS_FAILED_PUBLISHING', \count($cid)), 'error'); + $this->app->enqueueMessage(Text::plural($this->text_prefix . '_N_ITEMS_FAILED_PUBLISHING', \count($cid)), 'error'); } else { diff --git a/libraries/src/Mail/MailTemplate.php b/libraries/src/Mail/MailTemplate.php index d60ef39b87f0d..994fc90f1adb8 100644 --- a/libraries/src/Mail/MailTemplate.php +++ b/libraries/src/Mail/MailTemplate.php @@ -190,6 +190,12 @@ public function send() $mail = self::getTemplate($this->template_id, $this->language); + // If the Mail Template was not found in the db, we cannot send an email. + if ($mail === null) + { + return false; + } + /** @var Registry $params */ $params = $mail->params; $app = Factory::getApplication(); @@ -370,7 +376,7 @@ protected function replaceTags($text, $tags) * @param string $key Template identifier * @param string $language Language code of the template * - * @return object An object with the data of the mail + * @return object|null An object with the data of the mail, or null if the template not found in the db. * * @since 4.0.0 */ diff --git a/libraries/src/Uri/Uri.php b/libraries/src/Uri/Uri.php index e27c98385f364..6d7f0175c0718 100644 --- a/libraries/src/Uri/Uri.php +++ b/libraries/src/Uri/Uri.php @@ -148,12 +148,14 @@ public static function base($pathonly = false) static::$base['prefix'] = $uri->toString(array('scheme', 'host', 'port')); static::$base['path'] = rtrim($uri->toString(array('path')), '/\\'); - if (\defined('JPATH_BASE') && \defined('JPATH_ADMINISTRATOR')) + if (\defined('JPATH_BASE') && \defined('JPATH_ADMINISTRATOR') && JPATH_BASE == JPATH_ADMINISTRATOR) { - if (JPATH_BASE == JPATH_ADMINISTRATOR) - { - static::$base['path'] .= '/administrator'; - } + static::$base['path'] .= '/administrator'; + } + + if (\defined('JPATH_BASE') && \defined('JPATH_API') && JPATH_BASE == JPATH_API) + { + static::$base['path'] .= '/api'; } } else diff --git a/plugins/fields/imagelist/tmpl/imagelist.php b/plugins/fields/imagelist/tmpl/imagelist.php index 700e5281139c5..ea8c42ac939e3 100644 --- a/plugins/fields/imagelist/tmpl/imagelist.php +++ b/plugins/fields/imagelist/tmpl/imagelist.php @@ -37,7 +37,7 @@ if ($fieldParams->get('directory', '/') !== '/') { - $imageInfo = Image::getImageFileProperties('images/' . $fieldParams->get('directory') . '/' . $imageFilePath); + $imageInfo = Image::getImageFileProperties(JPATH_ROOT . '/images/' . $fieldParams->get('directory') . '/' . $imageFilePath); $buffer .= sprintf('', $imageInfo->width, @@ -49,7 +49,7 @@ } else { - $imageInfo = Image::getImageFileProperties('images/' . $imageFilePath); + $imageInfo = Image::getImageFileProperties(JPATH_ROOT . '/images/' . $imageFilePath); $buffer .= sprintf('', $imageInfo->width, diff --git a/plugins/sampledata/blog/blog.php b/plugins/sampledata/blog/blog.php index 47d40aca5ca9c..cf41cb6d150bb 100644 --- a/plugins/sampledata/blog/blog.php +++ b/plugins/sampledata/blog/blog.php @@ -565,12 +565,14 @@ public function onAjaxSampledataApplyStep1() 'featured' => 1, 'tags' => array_map('strval', $tagIds), 'images' => array( - 'image_intro' => 'images/sampledata/cassiopeia/nasa1-1200.jpg', + 'image_intro' => 'images/sampledata/cassiopeia/nasa1-1200.jpg#' + . 'joomlaImage://local-images/sampledata/cassiopeia/nasa1-1200.jpg?width=1200&height=400', 'float_intro' => '', 'image_intro_alt' => Text::_('PLG_SAMPLEDATA_BLOG_SAMPLEDATA_CONTENT_ARTICLE_2_INTROIMAGE_ALT'), 'image_intro_alt_empty' => '', 'image_intro_caption' => '', - 'image_fulltext' => 'images/sampledata/cassiopeia/nasa1-400.jpg', + 'image_fulltext' => 'images/sampledata/cassiopeia/nasa1-400.jpg#' + . 'joomlaImage://local-images/sampledata/cassiopeia/nasa1-400.jpg?width=400&height=400', 'float_fulltext' => 'float-start', 'image_fulltext_alt' => '', 'image_fulltext_alt_empty' => 1, @@ -583,12 +585,14 @@ public function onAjaxSampledataApplyStep1() 'featured' => 1, 'tags' => array_map('strval', $tagIds), 'images' => array( - 'image_intro' => 'images/sampledata/cassiopeia/nasa2-1200.jpg', + 'image_intro' => 'images/sampledata/cassiopeia/nasa2-1200.jpg#' + . 'joomlaImage://local-images/sampledata/cassiopeia/nasa2-1200.jpg?width=1200&height=400', 'float_intro' => '', 'image_intro_alt' => '', 'image_intro_alt_empty' => 1, 'image_intro_caption' => '', - 'image_fulltext' => 'images/sampledata/cassiopeia/nasa2-400.jpg', + 'image_fulltext' => 'images/sampledata/cassiopeia/nasa2-400.jpg#' + . 'joomlaImage://local-images/sampledata/cassiopeia/nasa2-400.jpg?width=400&height=400', 'float_fulltext' => 'float-start', 'image_fulltext_alt' => '', 'image_fulltext_alt_empty' => 1, @@ -602,12 +606,14 @@ public function onAjaxSampledataApplyStep1() 'featured' => 1, 'tags' => array_map('strval', $tagIds), 'images' => array( - 'image_intro' => 'images/sampledata/cassiopeia/nasa3-1200.jpg', + 'image_intro' => 'images/sampledata/cassiopeia/nasa3-1200.jpg#' + . 'joomlaImage://local-images/sampledata/cassiopeia/nasa3-1200.jpg?width=1200&height=400', 'float_intro' => '', 'image_intro_alt' => '', 'image_intro_alt_empty' => 1, 'image_intro_caption' => '', - 'image_fulltext' => 'images/sampledata/cassiopeia/nasa3-400.jpg', + 'image_fulltext' => 'images/sampledata/cassiopeia/nasa3-400.jpg#' + . 'joomlaImage://local-images/sampledata/cassiopeia/nasa3-400.jpg?width=400&height=400', 'float_fulltext' => 'float-start', 'image_fulltext_alt' => Text::_('PLG_SAMPLEDATA_BLOG_SAMPLEDATA_CONTENT_ARTICLE_4_FULLTEXTIMAGE_ALT'), 'image_fulltext_alt_empty' => '', @@ -620,16 +626,18 @@ public function onAjaxSampledataApplyStep1() 'featured' => 1, 'tags' => array_map('strval', $tagIds), 'images' => array( - 'image_intro' => 'images/sampledata/cassiopeia/nasa4-1200.jpg', + 'image_intro' => 'images/sampledata/cassiopeia/nasa4-1200.jpg#' + . 'joomlaImage://local-images/sampledata/cassiopeia/nasa4-1200.jpg?width=1200&height=400', 'float_intro' => '', 'image_intro_alt' => '', 'image_intro_alt_empty' => 1, 'image_intro_caption' => '', - 'image_fulltext' => 'images/sampledata/cassiopeia/nasa4-400.jpg', + 'image_fulltext' => 'images/sampledata/cassiopeia/nasa4-400.jpg#' + . 'joomlaImage://local-images/sampledata/cassiopeia/nasa4-400.jpg?width=400&height=400', 'float_fulltext' => 'float-start', 'image_fulltext_alt' => '', 'image_fulltext_alt_empty' => 1, - 'image_fulltext_caption' => 'www.nasa.gov/multimedia/imagegallery', + 'image_fulltext_caption' => 'www.nasa.gov/multimedia/imagegallery', ), ), // Category 2 = Joomla - marketing texts @@ -637,7 +645,8 @@ public function onAjaxSampledataApplyStep1() // Article 6 - Millions 'catid' => $catIds[2], 'images' => array( - 'image_intro' => 'images/sampledata/cassiopeia/nasa1-640.jpg', + 'image_intro' => 'images/sampledata/cassiopeia/nasa1-640.jpg#' + . 'joomlaImage://local-images/sampledata/cassiopeia/nasa1-640.jpg?width=640&height=320', 'float_intro' => '', 'image_intro_alt' => '', 'image_intro_alt_empty' => 1, @@ -648,7 +657,8 @@ public function onAjaxSampledataApplyStep1() // Article 7 - Love 'catid' => $catIds[2], 'images' => array( - 'image_intro' => 'images/sampledata/cassiopeia/nasa2-640.jpg', + 'image_intro' => 'images/sampledata/cassiopeia/nasa2-640.jpg#' + . 'joomlaImage://local-images/sampledata/cassiopeia/nasa2-640.jpg?width=640&height=320', 'float_intro' => '', 'image_intro_alt' => '', 'image_intro_alt_empty' => 1, @@ -659,7 +669,8 @@ public function onAjaxSampledataApplyStep1() // Article 8 - Joomla 'catid' => $catIds[2], 'images' => array( - 'image_intro' => 'images/sampledata/cassiopeia/nasa3-640.jpg', + 'image_intro' => 'images/sampledata/cassiopeia/nasa3-640.jpg#' + . 'joomlaImage://local-images/sampledata/cassiopeia/nasa3-640.jpg?width=640&height=320', 'float_intro' => '', 'image_intro_alt' => '', 'image_intro_alt_empty' => 1, @@ -675,7 +686,8 @@ public function onAjaxSampledataApplyStep1() 'image_intro_alt' => '', 'image_intro_alt_empty' => '', 'image_intro_caption' => '', - 'image_fulltext' => 'images/sampledata/cassiopeia/nasa4-400.jpg', + 'image_fulltext' => 'images/sampledata/cassiopeia/nasa4-400.jpg#' + . 'joomlaImage://local-images/sampledata/cassiopeia/nasa4-400.jpg?width=400&height=400', 'float_fulltext' => 'float-end', 'image_fulltext_alt' => '', 'image_fulltext_alt_empty' => 1, @@ -1635,7 +1647,7 @@ public function onAjaxSampledataApplyStep3() 'showtitle' => 0, 'params' => array( 'prepare_content' => 0, - 'backgroundimage' => 'images/banners/banner.jpg', + 'backgroundimage' => 'images/banners/banner.jpg#joomlaImage://local-images/banners/banner.jpg?width=1140&height=600', 'layout' => 'cassiopeia:banner', 'moduleclass_sfx' => '', 'cache' => 1, From dc81fb4dcee4fecd976a17db62ebe2b7c030417d Mon Sep 17 00:00:00 2001 From: Tushar Date: Thu, 6 Jan 2022 17:10:30 +0530 Subject: [PATCH 05/28] Fix task queue behavior with orphaned tasks (#36436) Excludes orphaned tasks from TaskModel::getTask()'s task locking query so don't end up acquiring locks/trying to run orphaned tasks. Co-authored-by: Benjamin Trenkle --- .../com_scheduler/src/Model/TaskModel.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/administrator/components/com_scheduler/src/Model/TaskModel.php b/administrator/components/com_scheduler/src/Model/TaskModel.php index d623618b0b08d..5e98e0a79fa56 100644 --- a/administrator/components/com_scheduler/src/Model/TaskModel.php +++ b/administrator/components/com_scheduler/src/Model/TaskModel.php @@ -28,6 +28,7 @@ use Joomla\Component\Scheduler\Administrator\Helper\ExecRuleHelper; use Joomla\Component\Scheduler\Administrator\Helper\SchedulerHelper; use Joomla\Component\Scheduler\Administrator\Table\TaskTable; +use Joomla\Component\Scheduler\Administrator\Task\TaskOption; use Joomla\Database\ParameterType; use Symfony\Component\OptionsResolver\Exception\AccessException; use Symfony\Component\OptionsResolver\Exception\InvalidOptionsException; @@ -413,6 +414,18 @@ public function getTask(array $options = []): ?\stdClass ->set($db->quoteName('locked') . ' = :now1') ->bind(':now1', $now); + // Array of all active routine ids + $activeRoutines = array_map( + static function (TaskOption $taskOption): string + { + return $taskOption->type; + }, + SchedulerHelper::getTaskOptions()->options + ); + + // "Orphaned" tasks are not a part of the task queue! + $lockQuery->whereIn($db->quoteName('type'), $activeRoutines, ParameterType::STRING); + // If directed, exclude CLI exclusive tasks if (!$options['includeCliExclusive']) { From ac2afac76a1c441707a386031c2cd29f5776ee16 Mon Sep 17 00:00:00 2001 From: Allon Moritz Date: Thu, 6 Jan 2022 12:47:22 +0100 Subject: [PATCH 06/28] Add form layout option to custom fields (#36551) --- .../com_fields/src/Plugin/FieldsPlugin.php | 5 +++++ administrator/language/en-GB/com_fields.ini | 1 + administrator/language/en-GB/plg_fields_list.ini | 1 + administrator/language/en-GB/plg_fields_radio.ini | 2 ++ administrator/language/en-GB/plg_fields_sql.ini | 1 + plugins/fields/list/params/list.xml | 15 +++++++++++++++ plugins/fields/radio/params/radio.xml | 11 +++++++++++ plugins/fields/sql/params/sql.xml | 15 +++++++++++++++ 8 files changed, 51 insertions(+) diff --git a/administrator/components/com_fields/src/Plugin/FieldsPlugin.php b/administrator/components/com_fields/src/Plugin/FieldsPlugin.php index 2c674e5a06cef..a77e45fda7172 100644 --- a/administrator/components/com_fields/src/Plugin/FieldsPlugin.php +++ b/administrator/components/com_fields/src/Plugin/FieldsPlugin.php @@ -200,6 +200,11 @@ public function onCustomFieldsPrepareDom($field, \DOMElement $parent, Form $form $node->setAttribute('hint', $field->params->get('hint', '')); $node->setAttribute('required', $field->required ? 'true' : 'false'); + if ($layout = $field->params->get('form_layout')) + { + $node->setAttribute('layout', $layout); + } + if ($field->default_value !== '') { $defaultNode = $node->appendChild(new \DOMElement('default')); diff --git a/administrator/language/en-GB/com_fields.ini b/administrator/language/en-GB/com_fields.ini index f020bac7822e9..1d65e31a4445c 100644 --- a/administrator/language/en-GB/com_fields.ini +++ b/administrator/language/en-GB/com_fields.ini @@ -21,6 +21,7 @@ COM_FIELDS_FIELD_EDITABLE_IN_BOTH="Both" COM_FIELDS_FIELD_EDITABLE_IN_LABEL="Editable In" COM_FIELDS_FIELD_EDITABLE_IN_SITE="Site" COM_FIELDS_FIELD_FORM_EDIT="Edit Field" +COM_FIELDS_FIELD_FORM_LAYOUT_LABEL="Layout" COM_FIELDS_FIELD_FORM_NEW="New Field" COM_FIELDS_FIELD_FORMOPTIONS_HEADING="Form Options" COM_FIELDS_FIELD_GROUP_LABEL="Field Group" diff --git a/administrator/language/en-GB/plg_fields_list.ini b/administrator/language/en-GB/plg_fields_list.ini index f3b4e535323f2..5eeb5f3d4b567 100644 --- a/administrator/language/en-GB/plg_fields_list.ini +++ b/administrator/language/en-GB/plg_fields_list.ini @@ -5,6 +5,7 @@ PLG_FIELDS_LIST="Fields - List" PLG_FIELDS_LIST_LABEL="List (%s)" +PLG_FIELDS_LIST_PARAMS_FORM_LAYOUT_FANCY_SELECT="Enhanced select" PLG_FIELDS_LIST_PARAMS_MULTIPLE_LABEL="Multiple" PLG_FIELDS_LIST_PARAMS_OPTIONS_LABEL="List Values" PLG_FIELDS_LIST_PARAMS_OPTIONS_NAME_LABEL="Text" diff --git a/administrator/language/en-GB/plg_fields_radio.ini b/administrator/language/en-GB/plg_fields_radio.ini index fb82a5bfd0114..bd3fa1089e2ae 100644 --- a/administrator/language/en-GB/plg_fields_radio.ini +++ b/administrator/language/en-GB/plg_fields_radio.ini @@ -5,6 +5,8 @@ PLG_FIELDS_RADIO="Fields - Radio" PLG_FIELDS_RADIO_LABEL="Radio (%s)" +PLG_FIELDS_RADIO_PARAMS_FORM_LAYOUT_BUTTONS="Buttons" +PLG_FIELDS_RADIO_PARAMS_FORM_LAYOUT_SWITCHER="Switcher" PLG_FIELDS_RADIO_PARAMS_OPTIONS_LABEL="Radio Values" PLG_FIELDS_RADIO_PARAMS_OPTIONS_NAME_LABEL="Text" PLG_FIELDS_RADIO_PARAMS_OPTIONS_VALUE_LABEL="Value" diff --git a/administrator/language/en-GB/plg_fields_sql.ini b/administrator/language/en-GB/plg_fields_sql.ini index 5744e7f541109..26552719cbb48 100644 --- a/administrator/language/en-GB/plg_fields_sql.ini +++ b/administrator/language/en-GB/plg_fields_sql.ini @@ -6,6 +6,7 @@ PLG_FIELDS_SQL="Fields - SQL" PLG_FIELDS_SQL_CREATE_NOT_POSSIBLE="Only a Super User can create or edit an SQL field!" PLG_FIELDS_SQL_LABEL="SQL (%s)" +PLG_FIELDS_SQL_PARAMS_FORM_LAYOUT_FANCY_SELECT="Enhanced select" PLG_FIELDS_SQL_PARAMS_MULTIPLE_LABEL="Multiple" PLG_FIELDS_SQL_PARAMS_QUERY_DESC="The SQL query which will provide the data for the dropdown list. The query must return two columns; one called 'value' which will hold the values of the list items; the other called 'text' with the text in the dropdown list." ; The terms 'value' and 'text' should not be translated PLG_FIELDS_SQL_PARAMS_QUERY_LABEL="Query" diff --git a/plugins/fields/list/params/list.xml b/plugins/fields/list/params/list.xml index 65eaa320f6827..8c6396fb4eadf 100644 --- a/plugins/fields/list/params/list.xml +++ b/plugins/fields/list/params/list.xml @@ -40,4 +40,19 @@
+ +
+
+ + + + +
+
+
diff --git a/plugins/fields/radio/params/radio.xml b/plugins/fields/radio/params/radio.xml index 6cfbb85ad4446..071d21a72335f 100644 --- a/plugins/fields/radio/params/radio.xml +++ b/plugins/fields/radio/params/radio.xml @@ -39,6 +39,17 @@ default="btn-group" validate="CssIdentifier" /> +
+ + + + +
diff --git a/plugins/fields/sql/params/sql.xml b/plugins/fields/sql/params/sql.xml index 31ad4b09e5437..03e706f01eeea 100644 --- a/plugins/fields/sql/params/sql.xml +++ b/plugins/fields/sql/params/sql.xml @@ -25,4 +25,19 @@ + +
+
+ + + + +
+
+
From f0355582b87d259f8e3ffe812c444c75e56e04b2 Mon Sep 17 00:00:00 2001 From: Brian Teeman Date: Thu, 6 Jan 2022 11:56:31 +0000 Subject: [PATCH 07/28] [4.1] Template Override switches (#36366) * [4.1] Template Override switches For some reason the switches were not displayed in the same way as other similar switches. This leads to confusion (reported elsewhere) and the need for creating additional css. This Pr resolves that. Made against 4.1 as there are language string removals and additions and I dont know what the policy is for that in j4. ### Before ### After * filter boolean * remove the filters. this is not a form that is saved --- .../components/com_templates/forms/source.xml | 10 ++++++---- .../components/com_templates/tmpl/template/default.php | 4 ++-- administrator/language/en-GB/com_templates.ini | 6 ++---- .../com_templates/css/admin-templates-default.css | 9 --------- 4 files changed, 10 insertions(+), 19 deletions(-) diff --git a/administrator/components/com_templates/forms/source.xml b/administrator/components/com_templates/forms/source.xml index 07e78c88dabd8..ab8636636ff98 100644 --- a/administrator/components/com_templates/forms/source.xml +++ b/administrator/components/com_templates/forms/source.xml @@ -39,21 +39,23 @@ - - + + - - + + diff --git a/administrator/components/com_templates/tmpl/template/default.php b/administrator/components/com_templates/tmpl/template/default.php index 3cd903272c80e..a1157149446c2 100644 --- a/administrator/components/com_templates/tmpl/template/default.php +++ b/administrator/components/com_templates/tmpl/template/default.php @@ -79,8 +79,8 @@ type == 'file' && !empty($this->source->coreFile)) : ?>
- form->getInput('show_core'); ?> - form->getInput('show_diff'); ?> + form->renderField('show_core'); ?> + form->renderField('show_diff'); ?>
diff --git a/administrator/language/en-GB/com_templates.ini b/administrator/language/en-GB/com_templates.ini index e0b5094a4d695..1b2211b710697 100644 --- a/administrator/language/en-GB/com_templates.ini +++ b/administrator/language/en-GB/com_templates.ini @@ -147,10 +147,8 @@ COM_TEMPLATES_IMAGE_WIDTH="Width" COM_TEMPLATES_INVALID_FILE_NAME="Invalid file name. Please choose a file name with a-z, A-Z, 0-9, - and _." COM_TEMPLATES_INVALID_FILE_TYPE="File type not selected." COM_TEMPLATES_INVALID_FOLDER_NAME="Invalid folder name. Please choose a folder name with a-z, A-Z, 0-9, - and _." -COM_TEMPLATES_LAYOUTS_DIFFVIEW_HIDE_CORE="Hide Original" -COM_TEMPLATES_LAYOUTS_DIFFVIEW_HIDE_DIFF="Hide Differences" -COM_TEMPLATES_LAYOUTS_DIFFVIEW_SHOW_CORE="Show Original" -COM_TEMPLATES_LAYOUTS_DIFFVIEW_SHOW_DIFF="Show Differences" +COM_TEMPLATES_LAYOUTS_DIFFVIEW_CORE="Original File" +COM_TEMPLATES_LAYOUTS_DIFFVIEW_DIFF="Differences" COM_TEMPLATES_MANAGE_FOLDERS="Manage Folders" COM_TEMPLATES_MANAGER_ADD_STYLE="Templates: Add Style" COM_TEMPLATES_MANAGER_EDIT_STYLE="Templates: Edit Style" diff --git a/build/media_source/com_templates/css/admin-templates-default.css b/build/media_source/com_templates/css/admin-templates-default.css index 5f930753fff38..a92aa1935c07a 100644 --- a/build/media_source/com_templates/css/admin-templates-default.css +++ b/build/media_source/com_templates/css/admin-templates-default.css @@ -92,15 +92,6 @@ background-color: #F0F0EE; } -#jform_show_core { - display: inline; -} - -#jform_show_diff { - display: inline; - margin-left: 3.5em; -} - .switcher-label-0, .switcher-label-1 { white-space: nowrap; } From e83c62f73ea7e5ec7fd37e88ee9e71a6ceba1e37 Mon Sep 17 00:00:00 2001 From: Dimitris Grammatikogiannis Date: Thu, 6 Jan 2022 12:57:09 +0100 Subject: [PATCH 08/28] [4.1] Refactor tinyMCE code (#36253) * Refactor #.1 * Use traits, modularize the code * desc * Style * Update layouts/joomla/tinymce/textarea.php Co-authored-by: Phil E. Taylor * Update plugins/editors/tinymce/src/PluginTraits/DisplayTrait.php Co-authored-by: Phil E. Taylor * Update plugins/editors/tinymce/src/PluginTraits/DisplayTrait.php Co-authored-by: Phil E. Taylor * Update plugins/editors/tinymce/src/PluginTraits/DisplayTrait.php Co-authored-by: Phil E. Taylor * reorder imports * Update plugins/editors/tinymce/src/PluginTraits/GlobalFilters.php Co-authored-by: Phil E. Taylor * Update plugins/editors/tinymce/src/PluginTraits/KnownButtons.php Co-authored-by: Phil E. Taylor * Update plugins/editors/tinymce/src/PluginTraits/ToolbarPresets.php Co-authored-by: Phil E. Taylor * More CS * Extra padding in comments * Update plugins/editors/tinymce/src/PluginTraits/GlobalFilters.php Co-authored-by: Phil E. Taylor * Some CS * Update XTDButtons.php * Update GlobalFilters.php * Update DisplayTrait.php Co-authored-by: Phil E. Taylor --- layouts/joomla/tinymce/textarea.php | 15 +- .../src/PluginTraits/ActiveSiteTemplate.php | 57 + .../tinymce/src/PluginTraits/DisplayTrait.php | 547 ++++++++ .../src/PluginTraits/GlobalFilters.php | 207 +++ .../tinymce/src/PluginTraits/KnownButtons.php | 104 ++ .../tinymce/src/PluginTraits/ResolveFiles.php | 120 ++ .../src/PluginTraits/ToolbarPresets.php | 84 ++ .../tinymce/src/PluginTraits/XTDButtons.php | 83 ++ plugins/editors/tinymce/tinymce.php | 1195 +---------------- 9 files changed, 1220 insertions(+), 1192 deletions(-) create mode 100644 plugins/editors/tinymce/src/PluginTraits/ActiveSiteTemplate.php create mode 100644 plugins/editors/tinymce/src/PluginTraits/DisplayTrait.php create mode 100644 plugins/editors/tinymce/src/PluginTraits/GlobalFilters.php create mode 100644 plugins/editors/tinymce/src/PluginTraits/KnownButtons.php create mode 100644 plugins/editors/tinymce/src/PluginTraits/ResolveFiles.php create mode 100644 plugins/editors/tinymce/src/PluginTraits/ToolbarPresets.php create mode 100644 plugins/editors/tinymce/src/PluginTraits/XTDButtons.php diff --git a/layouts/joomla/tinymce/textarea.php b/layouts/joomla/tinymce/textarea.php index 0616bf34ae159..bd8aef31c731a 100644 --- a/layouts/joomla/tinymce/textarea.php +++ b/layouts/joomla/tinymce/textarea.php @@ -6,11 +6,24 @@ * @copyright (C) 2013 Open Source Matters, Inc. * @license GNU General Public License version 2 or later; see LICENSE.txt */ - defined('_JEXEC') or die; +use Joomla\CMS\Factory; + $data = $displayData; +$wa = Factory::getDocument()->getWebAssetManager(); + +if (!$wa->assetExists('script', 'tinymce')) +{ + $wa->registerScript('tinymce', 'media/vendor/tinymce/tinymce.min.js', [], ['defer' => true]); +} + +if (!$wa->assetExists('script', 'plg_editors_tinymce')) +{ + $wa->registerScript('plg_editors_tinymce', 'plg_editors_tinymce/tinymce.min.js', [], ['defer' => true], ['core', 'tinymce']); +} +$wa->useScript('tinymce')->useScript('plg_editors_tinymce'); ?>