Staff replied Helix Framework Joomla 6 v2.2.11

Helix Ultimate System Plugin Overrides Incompatible with Joomla 6.2 (`triggerEvent`, `mod_breadcrumbs` JSON Escaping, `mod_login` Parameters)

Asked by Philip S. Hempel 4 days ago Last activity 4 days ago

Helix Ultimate System Plugin Overrides Incompatible with Joomla 6.2 (triggerEvent, mod_breadcrumbs JSON Escaping, mod_login Parameters)

  • Product: JoomShaper Helix Ultimate (plg_system_helixultimate / shaper_helixultimate)
  • Product Version: 2.2.11
  • Joomla Version: 6.2.0 (PHP 8.4)
  • File: plugins/system/helixultimate/overrides/ (com_content/category/blog.php, mod_breadcrumbs/default.php, mod_login/default.php, and com_content/form/edit.php)

What the Bug Is

Several template overrides bundled inside plugins/system/helixultimate/overrides/ remain on Joomla 4/5 patterns that break or miss core features on Joomla 6.2:

  1. com_content/category/blog.php calls $app->triggerEvent(...) (deprecated/removed in favor of typed DispatcherInterface::dispatch() events) and checks !empty($this->children[$this->category->id]) instead of $this->category->hasVisibleChildren(...).
  2. mod_breadcrumbs/default.php encodes JSON-LD schema inside an application/ld+json script block without JSON_HEX_TAG | JSON_HEX_AMP | JSON_HEX_APOS | JSON_HEX_QUOT.
  3. mod_login/default.php renders the password reset and username reminder links unconditionally without checking $params->get('showPasswordReset', 1) and $params->get('showUsernameReminder', 1).
  4. com_content/form/edit.php omits the Joomla 6 imgclass_intro and imgclass_fulltext fields.

How to Reproduce It

  1. Install Helix Ultimate 2.2.11 on Joomla 6.2.0.
  2. Run Joomla's Template Overrides Update Check in Administrator -> System -> Templates -> Site Templates, or render a Category Blog view / Login module with showPasswordReset disabled.

Fix (Unified Patch Against Clean plg_system_helixultimate 2.2.11)

--- a/plugins/system/helixultimate/overrides/com_content/category/blog.php
+++ b/plugins/system/helixultimate/overrides/com_content/category/blog.php
@@ -17,20 +17,16 @@

 HTMLHelper::addIncludePath(JPATH_COMPONENT . '/helpers');

-$app = Factory::getApplication();
-
-// Content events
+$dispatcher = Factory::getContainer()->get(\Joomla\Event\DispatcherInterface::class);
 $this->category->text = $this->category->description;
-$app->triggerEvent('onContentPrepare', array($this->category->extension . '.categories', &$this->category, &$this->params, 0));
+$contentEventArguments = ['context' => $this->category->extension . '.categories', 'subject' => $this->category, 'params' => $this->params, 'page' => 0];
+$dispatcher->dispatch('onContentPrepare', new \Joomla\CMS\Event\Content\ContentPrepareEvent('onContentPrepare', $contentEventArguments));
 $this->category->description = $this->category->text;
-
-$results = $app->triggerEvent('onContentAfterTitle', array($this->category->extension . '.categories', &$this->category, &$this->params, 0));
+$results = $dispatcher->dispatch('onContentAfterTitle', new \Joomla\CMS\Event\Content\AfterTitleEvent('onContentAfterTitle', $contentEventArguments))->getArgument('result', []);
 $afterDisplayTitle = trim(implode("\n", $results));
-
-$results = $app->triggerEvent('onContentBeforeDisplay', array($this->category->extension . '.categories', &$this->category, &$this->params, 0));
+$results = $dispatcher->dispatch('onContentBeforeDisplay', new \Joomla\CMS\Event\Content\BeforeDisplayEvent('onContentBeforeDisplay', $contentEventArguments))->getArgument('result', []);
 $beforeDisplayContent = trim(implode("\n", $results));
-
-$results = $app->triggerEvent('onContentAfterDisplay', array($this->category->extension . '.categories', &$this->category, &$this->params, 0));
+$results = $dispatcher->dispatch('onContentAfterDisplay', new \Joomla\CMS\Event\Content\AfterDisplayEvent('onContentAfterDisplay', $contentEventArguments))->getArgument('result', []);
 $afterDisplayContent = trim(implode("\n", $results));

 // Columns + Helix blog list type
@@ -188,7 +184,7 @@
        </div>
    <​?php endif; ?​>

-    <​?php if ($this->maxLevel != 0 && !empty($this->children[$this->category->id])) : ?​>
+    <​?php if ($this->maxLevel != 0 && $this->category->hasVisibleChildren($this->getCurrentUser()->getAuthorisedViewLevels(), (bool) $this->params->get('show_empty_categories', 0))) : ?​>
         <div class="com-content-category-blog__children cat-children">
             <​?php if ($this->params->get('show_category_heading_title_text', 1) == 1) : ?​>
                 <h3> <​?php echo Text::_('JGLOBAL_SUBCATEGORIES'); ?​> </h3>
--- a/plugins/system/helixultimate/overrides/mod_breadcrumbs/default.php
+++ b/plugins/system/helixultimate/overrides/mod_breadcrumbs/default.php
@@ -118,7 +118,7 @@
         /** @var WebAssetManager $wa */
         $wa = $app->getDocument()->getWebAssetManager();
         $prettyPrint = JDEBUG ? JSON_PRETTY_PRINT : 0;
-        $wa->addInline('script', json_encode($data, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE | $prettyPrint), [], ['type' => 'application/ld+json']);
+        $wa->addInline('script', json_encode($data, JSON_UNESCAPED_SLASHES | JSON_HEX_TAG | JSON_HEX_AMP | JSON_HEX_APOS | JSON_HEX_QUOT | JSON_UNESCAPED_UNICODE | $prettyPrint), [], ['type' => 'application/ld+json']);
     }
     ?​>
 </nav>
--- a/plugins/system/helixultimate/overrides/mod_login/default.php
+++ b/plugins/system/helixultimate/overrides/mod_login/default.php
@@ -119,12 +119,16 @@

         <​?php $usersConfig = ComponentHelper::getParams('com_users'); ?​>
         <div class="mod-login__options  list-group">
+            <​?php if ($params->get('showPasswordReset', 1)) : ?​>
             <a class="mod-login__reset list-group-item" href="/<​?php echo Route::_('index.php?option=com_users&view=reset'); ?​>">
                 <​?php echo Text::_('MOD_LOGIN_FORGOT_YOUR_PASSWORD'); ?​>
             </a>
+            <​?php endif; ?​>
+            <​?php if ($params->get('showUsernameReminder', 1)) : ?​>
             <a class="mod-login__remind list-group-item" href="/<​?php echo Route::_('index.php?option=com_users&view=remind'); ?​>">
                 <​?php echo Text::_('MOD_LOGIN_FORGOT_YOUR_USERNAME'); ?​>
             </a>
+            <​?php endif; ?​>
             <​?php if ($usersConfig->get('allowUserRegistration')) : ?​>
                 <a class="mod-login__register list-group-item" href="/<​?php echo Route::_('index.php?option=com_users&view=registration'); ?​>">
                     <​?php echo Text::_('MOD_LOGIN_REGISTER'); ?​>                
--- a/plugins/system/helixultimate/overrides/com_content/form/edit.php
+++ b/plugins/system/helixultimate/overrides/com_content/form/edit.php
@@ -95,6 +95,7 @@
                             <​?php echo $this->form->renderField('image_intro', 'images'); ?​>
                             <​?php echo $this->form->renderField('image_intro_alt', 'images'); ?​>
                             <​?php echo $this->form->renderField('image_intro_alt_empty', 'images'); ?​>
+                            <​?php echo $this->form->renderField('imgclass_intro', 'images'); ?​>
                             <​?php echo $this->form->renderField('image_intro_caption', 'images'); ?​>
                             <​?php echo $this->form->renderField('float_intro', 'images'); ?​>
                         </div>
@@ -103,6 +104,7 @@
                             <​?php echo $this->form->renderField('image_fulltext', 'images'); ?​>
                             <​?php echo $this->form->renderField('image_fulltext_alt', 'images'); ?​>
                             <​?php echo $this->form->renderField('image_fulltext_alt_empty', 'images'); ?​>
+                            <​?php echo $this->form->renderField('imgclass_fulltext', 'images'); ?​>
                             <​?php echo $this->form->renderField('image_fulltext_caption', 'images'); ?​>
                             <​?php echo $this->form->renderField('float_fulltext', 'images'); ?​>
                         </div>

1 reply

Anne Staff

Hello Philip,

Thank you for the detailed bug report and for providing the reproduction steps and proposed fix. We’ll forward this to our development team for review so they can investigate the issue and take the necessary steps to address it.

Regards

Log in to reply.