Bug found in mod_sobi2simplefeatured v2.0.6
Problem DescriptionIf you are using
Custom Module Templates, mod_sobi2simplefeatured may not load the
custom_template.helper.php associated with the custom template.
This problem can occur;
IF
(a) there is more than one copy/instance of mod_sobi2simplefeatured published on the same 'page',
AND,
(b) those copies/instances have different 'Advanced Parameters->Module Output Template' configurations.
SolutionAt this time, I am unable to provide a 'quick fix' solution to this problem.
Currently, class mod_sobi2simplefeaturedTemplate extends mod_sobi2simplefeaturedHelper class.
I may be able to solve the problem by using a separate class (rather than extending the mod_sobi2simplefeaturedHelper class) and then creating a new instance of the class for each instance of the module published on the 'page', but I will need to do more investigation and testing and a major re-write of mod_sobi2simplefeatured may be required.
Possible WorkaroundAll copies/instances of mod_sobi2simplefeatured published on the same 'page' must be configured with the same '
Advanced Parameters->Module Output Template' settings.
Technical ExplanationIn the file mod_sobi2simplefeatured.php, at around line 36, is the code;
# Include this Module HTML Template Helper Class for selected Template
class_exists($module->module.'Template')|| require($module_path.DS.'tmpl'.DS.$params->get('template').'.helper.php');If the PHP class 'mod_sobi2simplefeaturedTemplate' does not already exist, (the module has not been 'loaded'), then mod_sobi2simplefeatured.php will load the file;
MyJoomlaInstallation/modules/mod_sobi2simplefeatured/tmpl/
template.helper.php
where
template is the name of the Template configured in the module Advanced Parameters->Module Output Template
For example, if Advanced Parameters->Module Output Template = mycustom
then, the file;
MyJoomlaInstallation/modules/mod_sobi2simplefeatured/tmpl/mycustom.helper.php
will be loaded.
However, if the PHP class 'mod_sobi2simplefeaturedTemplate' already exists, (a copy/instance of the module has been loaded), then this file is not loaded.
So, if you have two instances of mod_sobi2simplefeatured published on the same 'page';
one configured with Template=default, and
the other configured with Template=mycustom
then
the template helper file (default.helper.php or mycustom.helper.php) associated with the first instance of the module published on the 'page' is the only one that is loaded.
Regards - Mark