Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[5.0] Upmerge #2889

Closed
jgerman-bot opened this issue Aug 12, 2023 · 0 comments · Fixed by #2912
Closed

[5.0] Upmerge #2889

jgerman-bot opened this issue Aug 12, 2023 · 0 comments · Fixed by #2912

Comments

@jgerman-bot
Copy link

New language relevant PR in upstream repo: joomla/joomla-cms#41333 Here are the upstream changes:

Click to expand the diff!
diff --git a/administrator/components/com_config/src/Controller/RequestController.php b/administrator/components/com_config/src/Controller/RequestController.php
index 4ecd25cdeb5ef..889f3282f1b59 100644
--- a/administrator/components/com_config/src/Controller/RequestController.php
+++ b/administrator/components/com_config/src/Controller/RequestController.php
@@ -65,15 +65,12 @@ public function getJson()
 
         try {
             $data = $model->getData();
-            $user = $this->app->getIdentity();
         } catch (\Exception $e) {
             $this->app->enqueueMessage($e->getMessage(), 'error');
 
             return false;
         }
 
-        $this->userIsSuperAdmin = $user->authorise('core.admin');
-
         // Required data
         $requiredData = [
             'sitename'            => null,
diff --git a/administrator/components/com_config/src/Dispatcher/Dispatcher.php b/administrator/components/com_config/src/Dispatcher/Dispatcher.php
index 6874ee33ea6f9..97bfa3b44ca9f 100644
--- a/administrator/components/com_config/src/Dispatcher/Dispatcher.php
+++ b/administrator/components/com_config/src/Dispatcher/Dispatcher.php
@@ -36,8 +36,8 @@ class Dispatcher extends ComponentDispatcher
      */
     protected function checkAccess(): void
     {
-        // sendtestmail expects json response, so we leave the method to handle the permission and send response itself
-        if ($this->input->getCmd('task') === 'application.sendtestmail') {
+        // sendtestmail and store do their own checks, so leave the method to handle the permission and send response itself
+        if (in_array($this->input->getCmd('task'), ['application.sendtestmail', 'application.store'], true)) {
             return;
         }
 
diff --git a/administrator/components/com_finder/src/Indexer/Language/Zh.php b/administrator/components/com_finder/src/Indexer/Language/Zh.php
index bfe598b52721a..5e8217e1d3301 100644
--- a/administrator/components/com_finder/src/Indexer/Language/Zh.php
+++ b/administrator/components/com_finder/src/Indexer/Language/Zh.php
@@ -11,7 +11,6 @@
 namespace Joomla\Component\Finder\Administrator\Indexer\Language;
 
 use Joomla\Component\Finder\Administrator\Indexer\Language;
-use Joomla\String\StringHelper;
 
 // phpcs:disable PSR1.Files.SideEffects
 \defined('_JEXEC') or die;
@@ -61,26 +60,11 @@ public function __construct($locale = null)
      */
     public function tokenise($input)
     {
-        $terms = parent::tokenise($input);
-
-        // Iterate through the terms and test if they contain Chinese.
-        for ($i = 0, $n = count($terms); $i < $n; $i++) {
-            $charMatches = [];
-            $charCount   = preg_match_all('#[\p{Han}]#mui', $terms[$i], $charMatches);
-
-            // Split apart any groups of Chinese characters.
-            for ($j = 0; $j < $charCount; $j++) {
-                $tSplit = StringHelper::str_ireplace($charMatches[0][$j], '', $terms[$i], false);
+        // We first add whitespace around each Chinese character, so that our later code can easily split on this.
+        $input = preg_replace('#\p{Han}#mui', ' $0 ', $input);
 
-                if (!empty($tSplit)) {
-                    $terms[$i] = $tSplit;
-                } else {
-                    unset($terms[$i]);
-                }
-
-                $terms[] = $charMatches[0][$j];
-            }
-        }
+        // Now we split up the input into individual terms
+        $terms = parent::tokenise($input);
 
         return $terms;
     }
diff --git a/administrator/components/com_guidedtours/src/Controller/DisplayController.php b/administrator/components/com_guidedtours/src/Controller/DisplayController.php
index 3f83224df59c0..c5ef8a5738126 100644
--- a/administrator/components/com_guidedtours/src/Controller/DisplayController.php
+++ b/administrator/components/com_guidedtours/src/Controller/DisplayController.php
@@ -12,6 +12,7 @@
 
 use Joomla\CMS\Language\Text;
 use Joomla\CMS\MVC\Controller\BaseController;
+use Joomla\CMS\Plugin\PluginHelper;
 use Joomla\CMS\Router\Route;
 
 // phpcs:disable PSR1.Files.SideEffects
@@ -49,6 +50,11 @@ public function display($cachable = false, $urlparams = [])
         $layout = $this->input->get('layout', 'default');
         $id     = $this->input->getInt('id');
 
+        // Show messages about the disabled plugin
+        if ($view === 'tours' && !PluginHelper::isEnabled('system', 'guidedtours')) {
+            $this->app->enqueueMessage(Text::_('COM_GUIDEDTOURS_PLUGIN_DISABLED'), 'error');
+        }
+
         if ($view === 'tour' && $layout === 'edit' && !$this->checkEditId('com_guidedtours.edit.tour', $id)) {
             $this->setMessage(Text::sprintf('JLIB_APPLICATION_ERROR_UNHELD_ID', $id), 'error');
             $this->setRedirect(Route::_('index.php?option=com_guidedtours&view=tours', false));
diff --git a/administrator/language/en-GB/com_guidedtours.ini b/administrator/language/en-GB/com_guidedtours.ini
index a201bc70e1984..1e8d9cba02e20 100644
--- a/administrator/language/en-GB/com_guidedtours.ini
+++ b/administrator/language/en-GB/com_guidedtours.ini
@@ -42,6 +42,7 @@ COM_GUIDEDTOURS_N_ITEMS_UNPUBLISHED="%d items unpublished."
 COM_GUIDEDTOURS_NEW_TOUR="New Tour"
 COM_GUIDEDTOURS_ORDER_TYPE_ASC="Type ascending"
 COM_GUIDEDTOURS_ORDER_TYPE_DESC="Type descending"
+COM_GUIDEDTOURS_PLUGIN_DISABLED="The Guided Tours System Plugin is disabled. The Guided Tours module will not be displayed if this is not enabled."
 COM_GUIDEDTOURS_STEP_DESCRIPTION_TRANSLATION="Description (%s)"
 COM_GUIDEDTOURS_STEP_EDIT_STEP="Edit Step"
 COM_GUIDEDTOURS_STEP_FILTER_SEARCH_DESC="Search in title and note. Prefix with ID: to search for a step ID or DESCRIPTION: to search in description."
diff --git a/administrator/modules/mod_quickicon/src/Helper/QuickIconHelper.php b/administrator/modules/mod_quickicon/src/Helper/QuickIconHelper.php
index b0ed7434bf145..69d1fc7c06fb2 100644
--- a/administrator/modules/mod_quickicon/src/Helper/QuickIconHelper.php
+++ b/administrator/modules/mod_quickicon/src/Helper/QuickIconHelper.php
@@ -299,7 +299,7 @@ public function getButtons(Registry $params, CMSApplication $application = null)
                 $this->buttons[$key][] = $tmp;
             }
 
-            if (ComponentHelper::isEnabled('com_contacts') && $params->get('show_contact')) {
+            if (ComponentHelper::isEnabled('com_contact') && $params->get('show_contact')) {
                 $tmp = [
                     'image'   => 'icon-address-book contact',
                     'link'    => Route::_('index.php?option=com_contact&view=contacts'),
diff --git a/administrator/modules/mod_user/tmpl/default.php b/administrator/modules/mod_user/tmpl/default.php
index 61ff2bf5ca61d..e72715932e44f 100644
--- a/administrator/modules/mod_user/tmpl/default.php
+++ b/administrator/modules/mod_user/tmpl/default.php
@@ -28,12 +28,12 @@
 <div class="header-item-content dropdown header-profile">
     <button class="dropdown-toggle d-flex align-items-center ps-0 py-0" data-bs-toggle="dropdown" type="button"
         title="<?php echo Text::_('MOD_USER_MENU'); ?>">
-        <div class="header-item-icon">
+        <span class="header-item-icon">
             <span class="icon-user-circle" aria-hidden="true"></span>
-        </div>
-        <div class="header-item-text">
+        </span>
+        <span class="header-item-text">
             <?php echo Text::_('MOD_USER_MENU'); ?>
-        </div>
+        </span>
         <span class="icon-angle-down" aria-hidden="true"></span>
     </button>
     <div class="dropdown-menu dropdown-menu-end">
diff --git a/build/media_source/templates/administrator/atum/scss/_maps-atum.scss b/build/media_source/templates/administrator/atum/scss/_maps-atum.scss
new file mode 100644
index 0000000000000..be94436782186
--- /dev/null
+++ b/build/media_source/templates/administrator/atum/scss/_maps-atum.scss
@@ -0,0 +1,14 @@
+$theme-colors-text: map-merge((
+  "action": shade-color($base-color, 60%),
+  "error": shade-color($red-dark, 60%)
+), $theme-colors-text);
+
+$theme-colors-bg-subtle: map-merge((
+  "action": tint-color($base-color, 80%),
+  "error": tint-color($red-dark, 80%)
+), $theme-colors-bg-subtle);
+
+$theme-colors-border-subtle: map-merge((
+  "action": tint-color($base-color, 60%),
+  "error": tint-color($red-dark, 60%)
+), $theme-colors-border-subtle);
diff --git a/build/media_source/templates/administrator/atum/scss/_variables.scss b/build/media_source/templates/administrator/atum/scss/_variables.scss
index b5e44538c5914..0eb1b003284a0 100644
--- a/build/media_source/templates/administrator/atum/scss/_variables.scss
+++ b/build/media_source/templates/administrator/atum/scss/_variables.scss
@@ -53,8 +53,7 @@ $theme-colors: (
   "light":                           $gray-100,
   "dark":                            $gray-900,
   "action":                          $base-color,
-  "error":                           $red-dark,
-  "alert-success":                   $green-dark) !default;
+  "error":                           $red-dark) !default;
 
 $atum-colors: (
   template-sidebar-bg:             var(--template-bg-dark-80),
@@ -63,6 +62,7 @@ $atum-colors: (
   template-bg-light:               #f0f4fb, //light background color, frontend dashboard background
   template-link-color:             var(--link-color),
   template-text-light:             $white,
+  template-text-dark:              $atum-text-dark,
   template-special-color:          $dark-blue,
   template-contrast:               $light-blue,
   template-bg-dark:                hsl(var(--hue), 40%, 20%),
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 e94e69510a058..2e735c492d938 100644
--- a/build/media_source/templates/administrator/atum/scss/blocks/_login.scss
+++ b/build/media_source/templates/administrator/atum/scss/blocks/_login.scss
@@ -163,6 +163,7 @@
     align-self: flex-end;
     width: 100%;
     font-size: ($font-size-base * .875);
+    --body-color: var(--template-text-light);
     color: var(--template-text-light);
     text-align: center;
 
diff --git a/build/media_source/templates/administrator/atum/scss/template.scss b/build/media_source/templates/administrator/atum/scss/template.scss
index 7b29f6404068a..713d590ec27fb 100644
--- a/build/media_source/templates/administrator/atum/scss/template.scss
+++ b/build/media_source/templates/administrator/atum/scss/template.scss
@@ -7,6 +7,7 @@
 @import "../../../../../../media/vendor/bootstrap/scss/variables";
 @import "../../../../../../media/vendor/bootstrap/scss/variables-dark";
 @import "../../../../../../media/vendor/bootstrap/scss/maps";
+@import "maps-atum";
 @import "../../../../../../media/vendor/bootstrap/scss/mixins";
 @import "../../../../../../media/vendor/bootstrap/scss/utilities";
 
diff --git a/components/com_content/tmpl/archive/default.php b/components/com_content/tmpl/archive/default.php
index e749e93a4554b..116715a1985b4 100644
--- a/components/com_content/tmpl/archive/default.php
+++ b/components/com_content/tmpl/archive/default.php
@@ -25,29 +25,35 @@
 
 <form id="adminForm" action="<?php echo Route::_('index.php'); ?>" method="post" class="com-content-archive__form">
     <fieldset class="com-content-archive__filters filters">
-    <div class="filter-search form-inline">
-        <?php if ($this->params->get('filter_field') !== 'hide') : ?>
-        <div class="me-2">
-            <label class="filter-search-lbl visually-hidden" for="filter-search"><?php echo Text::_('COM_CONTENT_TITLE_FILTER_LABEL') . '&#160;'; ?></label>
-            <input type="text" name="filter-search" id="filter-search" value="<?php echo $this->escape($this->filter); ?>" class="inputbox col-md-2" onchange="document.getElementById('adminForm').submit();" placeholder="<?php echo Text::_('COM_CONTENT_TITLE_FILTER_LABEL'); ?>">
-        </div>
-        <?php endif; ?>
+        <legend class="visually-hidden">
+            <?php echo Text::_('COM_CONTENT_FORM_FILTER_LEGEND'); ?>
+        </legend>
+        <div class="filter-search form-inline">
+            <?php if ($this->params->get('filter_field') !== 'hide') : ?>
+            <div class="mb-2">
+                <label class="filter-search-lbl visually-hidden" for="filter-search"><?php echo Text::_('COM_CONTENT_TITLE_FILTER_LABEL') . '&#160;'; ?></label>
+                <input type="text" name="filter-search" id="filter-search" value="<?php echo $this->escape($this->filter); ?>" class="inputbox col-md-2" onchange="document.getElementById('adminForm').submit();" placeholder="<?php echo Text::_('COM_CONTENT_TITLE_FILTER_LABEL'); ?>">
+            </div>
+            <?php endif; ?>
 
-        <span class="me-2">
-        <?php echo $this->form->monthField; ?>
-        </span>
-        <span class="me-2">
-        <?php echo $this->form->yearField; ?>
-        </span>
-        <span class="me-2">
-        <?php echo $this->form->limitField; ?>
-        </span>
+            <span class="me-2">
+                <label class="visually-hidden" for="month"><?php echo Text::_('JMONTH'); ?></label>
+                <?php echo $this->form->monthField; ?>
+            </span>
+            <span class="me-2">
+                <label class="visually-hidden" for="year"><?php echo Text::_('JYEAR'); ?></label>
+                <?php echo $this->form->yearField; ?>
+            </span>
+            <span class="me-2">
+                <label class="visually-hidden" for="limit"><?php echo Text::_('JGLOBAL_DISPLAY_NUM'); ?></label>
+                <?php echo $this->form->limitField; ?>
+            </span>
 
-        <button type="submit" class="btn btn-primary" style="vertical-align: top;"><?php echo Text::_('JGLOBAL_FILTER_BUTTON'); ?></button>
-        <input type="hidden" name="view" value="archive">
-        <input type="hidden" name="option" value="com_content">
-        <input type="hidden" name="limitstart" value="0">
-    </div>
+            <button type="submit" class="btn btn-primary" style="vertical-align: top;"><?php echo Text::_('JGLOBAL_FILTER_BUTTON'); ?></button>
+            <input type="hidden" name="view" value="archive">
+            <input type="hidden" name="option" value="com_content">
+            <input type="hidden" name="limitstart" value="0">
+        </div>
     </fieldset>
 </form>
 <?php echo $this->loadTemplate('items'); ?>
diff --git a/libraries/src/Application/CMSApplication.php b/libraries/src/Application/CMSApplication.php
index aae85ccb8eb86..22e5fb8936526 100644
--- a/libraries/src/Application/CMSApplication.php
+++ b/libraries/src/Application/CMSApplication.php
@@ -430,7 +430,7 @@ protected function checkUserRequireReset($option, $view, $layout, $tasks)
      *
      * @since   3.2
      *
-     * @deprecated  4.0 will be removed in 6.0
+     * @deprecated  3.2 will be removed in 6.0
      *              Use get() instead
      *              Example: Factory::getApplication()->get($varname, $default);
      */
@@ -438,7 +438,7 @@ public function getCfg($varname, $default = null)
     {
         try {
             Log::add(
-                sprintf('%s() is deprecated and will be removed in 5.0. Use JFactory->getApplication()->get() instead.', __METHOD__),
+                sprintf('%s() is deprecated and will be removed in 6.0. Use Factory->getApplication()->get() instead.', __METHOD__),
                 Log::WARNING,
                 'deprecated'
             );
diff --git a/libraries/src/Exception/ExceptionHandler.php b/libraries/src/Exception/ExceptionHandler.php
index d9a4c9a12a5bf..f3e09e99514f2 100644
--- a/libraries/src/Exception/ExceptionHandler.php
+++ b/libraries/src/Exception/ExceptionHandler.php
@@ -95,6 +95,11 @@ public static function render(\Throwable $error)
                 $app->redirect('index.php');
             }
 
+            // Clear all opened Output buffers to prevent misrendering
+            for ($i = 0, $l = ob_get_level(); $i < $l; $i++) {
+                ob_end_clean();
+            }
+
             /*
              * Try and determine the format to render the error page in
              *
diff --git a/plugins/workflow/notification/src/Extension/Notification.php b/plugins/workflow/notification/src/Extension/Notification.php
index 864b15cb5ff55..ed172971c345a 100644
--- a/plugins/workflow/notification/src/Extension/Notification.php
+++ b/plugins/workflow/notification/src/Extension/Notification.php
@@ -209,7 +209,7 @@ public function onWorkflowAfterTransition(WorkflowTransitionEvent $event)
             foreach ($userIds as $user_id) {
                 $receiver = $this->getUserFactory()->loadUserById($user_id);
 
-                if ($receiver->authorise('core.manage', 'com_message')) {
+                if ($receiver->authorise('core.manage', 'com_messages')) {
                     // Load language for messaging
                     $lang = $this->languageFactory->createLanguage($user->getParam('admin_language', $defaultLanguage), $debug);
                     $lang->load('plg_workflow_notification');
@heelc29 heelc29 linked a pull request Aug 23, 2023 that will close this issue
@heelc29 heelc29 changed the title Upmerge [5.0] Upmerge Aug 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging a pull request may close this issue.

4 participants