No Code Attached Yet J3 Issue
avatar Ndot
Ndot
30 Oct 2020

Steps to reproduce the issue

When trying to get a module in the getAjax function I don't get the module when the page path is root or /index.php. (eg. www.mysite.com/index.php) everything works properly on any other page path (eg. www.mysite.com/some/path).

helper.php

public static function getAjax()
{
    $jinput = JFactory::getApplication()->
    $moduleTitle = $jinput->get('moduleTitle', '', 'STRING');
    $moduleId = $jinput->get('moduleId', '', 'STRING');

    // Get module twice for good measure
    $module = JModuleHelper::getModule('mod_mymodulename', $moduleTitle);
    $moduleById = JModuleHelper::getModuleById($moduleId);
	
    return var_dump($module, $moduleById);
}

Expected result

JModuleHelper::getModuleById() -> to return the module.
JModuleHelper::getModule() -> to return the module.

Actual result

JModuleHelper::getModuleById() -> returns a dummy module.
JModuleHelper::getModule() -> returns a dummy module.

System information

Database Type -> mysql
Database Version -> 8.0.22
PHP Version -> 7.4.3
Web Server -> Apache/2.4.41 (Ubuntu)
WebServer to PHP Interface -> apache2handler
Joomla! Version -> Joomla! 3.9.22 Stable [ Amani ] 6-October-2020 15:00 GMT
Joomla! Platform Version -> Joomla Platform 13.1.0 Stable [ Curiosity ] 24-Apr-2013 00:00 GMT

Additional comments

I'm working using a sample Joomla website. Also if I assign the module to all pages it will work on the "Home" page, but then the module will also appear on all other pages which is not intended.

avatar Ndot Ndot - open - 30 Oct 2020
avatar joomla-cms-bot joomla-cms-bot - change - 30 Oct 2020
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 30 Oct 2020
avatar SharkyKZ
SharkyKZ - comment - 31 Oct 2020

Expected behavior. JModuleHelper loads only modules meant to be rendered on current page.

avatar Ndot
Ndot - comment - 31 Oct 2020

@SharkyKZ I have the module assigned to the "Home" page so as per what you said JModuleHelper should load the module.

Note: The module is being rendered on the page, so inside getAjax I should be able to load the module.

avatar jwaisner jwaisner - change - 2 Nov 2020
Labels Added: J3 Issue
avatar jwaisner jwaisner - labeled - 2 Nov 2020
avatar brianteeman
brianteeman - comment - 27 Aug 2022

Thank you for raising this issue.

Joomla 3 is now in security only mode with no further bug fixes or new features.

As this issue doesn't relate to Joomla 4 it will now been closed.

If we are mistaken and this does apply to Joomla 4 please open a new issue (and reference this one if you wish) with updated details for testing in Joomla 4.
cc @zero-24

avatar Fedik Fedik - change - 27 Aug 2022
Status New Closed
Closed_Date 0000-00-00 00:00:00 2022-08-27 19:23:52
Closed_By Fedik
Labels Added: No Code Attached Yet
Removed: ?
avatar Fedik Fedik - close - 27 Aug 2022

Add a Comment

Login with GitHub to post a comment