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);
}
JModuleHelper::getModuleById()
-> to return the module.
JModuleHelper::getModule()
-> to return the module.
JModuleHelper::getModuleById()
-> returns a dummy module.
JModuleHelper::getModule()
-> returns a dummy module.
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
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.
Labels |
Added:
?
|
Labels |
Added:
J3 Issue
|
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
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: ? |
Expected behavior.
JModuleHelper
loads only modules meant to be rendered on current page.