J4 Issue ? ?
avatar rdeutz
rdeutz
4 Nov 2015

The main effect is that the Module Style function is not working as expected. If someone used in a module file a var $template then this will overwrite the $template var in JModuleHelper\renderModule.

An example here BabDev/Tweet-Display-Back#97

Atm I don't have a good idea how to fix this, but I am open the issue so that it doesn't get lost.

avatar rdeutz rdeutz - open - 4 Nov 2015
avatar zero-24 zero-24 - change - 6 Nov 2015
Labels Added: ?
avatar zero-24 zero-24 - change - 7 Nov 2015
Category Libraries
avatar mbabker
mbabker - comment - 8 May 2016

This probably needs to be chucked into the 4.0 pile. JComponentHelper::renderComponent() deals with this same issue by using a scope isolated method to execute the component, but making the same change in JModuleHelper implies a B/C break. I figured out a list of all the variables that have "scope creeped" into the module's file (see https://github.com/BabDev/Tweet-Display-Back/blob/f699f1472e3acbb5966285b6a837d2706770145a/mod_tweetdisplayback.php#L14-L27) and I know those variables get used in my own code and in core extensions.

avatar brianteeman brianteeman - change - 10 May 2016
Labels Added: ?
avatar brianteeman brianteeman - change - 9 Dec 2016
Milestone Added:
avatar brianteeman brianteeman - change - 9 Dec 2016
The description was changed
avatar brianteeman brianteeman - edited - 9 Dec 2016
avatar brianteeman brianteeman - change - 9 Dec 2016
Milestone Added:
avatar franz-wohlkoenig franz-wohlkoenig - change - 4 Apr 2017
The description was changed
Status New Discussion
avatar joomla-cms-bot joomla-cms-bot - change - 4 Apr 2017
Status Discussion New
avatar joomla-cms-bot joomla-cms-bot - edited - 4 Apr 2017
avatar joomla-cms-bot joomla-cms-bot - change - 4 Apr 2017
Milestone Removed:
avatar franz-wohlkoenig franz-wohlkoenig - change - 4 Apr 2017
Status New Discussion
avatar joomla-cms-bot joomla-cms-bot - change - 4 Apr 2017
Milestone Added:
avatar joomla-cms-bot joomla-cms-bot - change - 4 Apr 2017
Milestone Removed:
avatar mbabker
mbabker - comment - 29 May 2017

Based on this list, we need to decide what needs to stay accessible for B/C and what could be "safely" removed:

/**
 * Module variables
 * -----------------
 * @var   object                     $module    A module object
 * @var   array                      $attribs   An array of attributes for the module (probably from the XML)
 * @var   array                      $chrome    The loaded module chrome files
 * @var   JApplicationCms            $app       The active application singleton
 * @var   string                     $scope     The application scope before the module was included
 * @var   \Joomla\Registry\Registry  $params    Module parameters
 * @var   string                     $template  The active template
 * @var   string                     $path      The path to this module file
 * @var   JLanguage                  $lang      The active JLanguage singleton
 * @var   string                     $content   Module output content
 */

Based on the result of that, we can create a scope isolated method to include modules (similar to the component helper).

Just shooting from the hip, $module and $params probably need to stay. I'm not sure if there is a valid requirement for the module to access $path (as at that point it should basically equate to __FILE__, the application, language, and template data are accessible through JFactory if needed, $chrome usually doesn't apply in the context of a module (that's a template detail), $scope is an internal thing, and I'm not quite sure what $attribs is for.

avatar brianteeman brianteeman - change - 25 Mar 2018
Labels Added: J4 Issue
avatar brianteeman brianteeman - labeled - 25 Mar 2018
avatar mbabker
mbabker - comment - 24 Jul 2018

Covered by #19834 in an indirect way.

avatar mbabker mbabker - change - 24 Jul 2018
Status Discussion Closed
Closed_Date 0000-00-00 00:00:00 2018-07-24 15:35:12
Closed_By mbabker
avatar mbabker mbabker - close - 24 Jul 2018
avatar rdeutz
rdeutz - comment - 24 Jul 2018

cool

Add a Comment

Login with GitHub to post a comment