? Pending

User tests: Successful: Unsuccessful:

avatar brianteeman
brianteeman
23 Aug 2022

In certain circumstances (see below) the module title is rendered multiple times.

Pull Request for Issue #37147 and #12888

Testing Instructions

Create a custom module and set the style to "card" and publish on all pages
Create an article and load the module inside the article using {loadmodule}
Check the frontend on any page thaat will display both the article and the module

Actual result BEFORE applying this Pull Request

image

Expected result AFTER applying this Pull Request

image

avatar brianteeman brianteeman - open - 23 Aug 2022
avatar brianteeman brianteeman - change - 23 Aug 2022
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 23 Aug 2022
Category Libraries
avatar brianteeman
brianteeman - comment - 23 Aug 2022

This closes the seventh oldest bug report from 2016 and annoyingly the fix has been here on github for 6 months but no one answered.

avatar RickR2H
RickR2H - comment - 23 Aug 2022

I have tested this item successfully on a7c2191


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/38571.

avatar RickR2H RickR2H - test_item - 23 Aug 2022 - Tested successfully
avatar viocassel
viocassel - comment - 23 Aug 2022

I have tested this item successfully on a7c2191

?


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/38571.

avatar viocassel viocassel - test_item - 23 Aug 2022 - Tested successfully
avatar RickR2H
RickR2H - comment - 23 Aug 2022

RTC


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/38571.

avatar RickR2H
RickR2H - comment - 23 Aug 2022

RTC


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/38571.

avatar RickR2H
RickR2H - comment - 23 Aug 2022

@bembelimen who can check the drone errors? The seems to be not related?

avatar Fedik
Fedik - comment - 24 Aug 2022

As a quick fix, I would suggest just clone a module, before this code:

$displayData = array(
'module' => $module,
'params' => $params,
'attribs' => $attribs,
);

$module = clone $module;

$displayData = array(
  'module'  => $module,
  'params'  => $params,
  'attribs' => $attribs,
);

With comment why it is cloned.

More advanced fix, is to cache a crome result separated from content and have a flag $module->chromeRendered. Similar to what we done for content:

public static function renderRawModule($module, Registry $params, $attribs = array())
{
if (!empty($module->contentRendered)) {
return $module->content;
}

upd: forget about cache, it have other drawbacks for "chrome"

avatar brianteeman
brianteeman - comment - 24 Aug 2022

Happy for you to submit a pr to my branch. Would be good to fix this very old bug

avatar Fedik
Fedik - comment - 24 Aug 2022

I made alternative one #38582 please test

avatar brianteeman
brianteeman - comment - 24 Aug 2022

Closed in favour of #38582

avatar brianteeman brianteeman - change - 24 Aug 2022
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2022-08-24 11:52:48
Closed_By brianteeman
Labels Added: ?
avatar brianteeman brianteeman - close - 24 Aug 2022

Add a Comment

Login with GitHub to post a comment