I see that all default modules store its helper.php file under Helper folder, for example modules/mod_articles_archive/src/Helper/ArticlesArchiveHelper.php
So I'm assuming when I create a custom module, I should place my helper.php file under folder :
modules/mod_my_module_name/src/Helper/ and name it MyModuleName.php
But when I try to use com_ajax within my module by using :
index.php?option=com_ajax&module=my_module_name&method=getList&format=json
it returned
{"success":false,"message":"The file at mod_my_module_name\/helper.php does not exist.","messages":null,"data":null}
Then when I look into com_ajax file : /components/com_ajax/ajax.php
the path is indeed hardcoded to :
$helperFile = JPATH_BASE . '/modules/mod_' . $module . '/helper.php';
Joomla 4 Beta 5
a better title for the issue: "[4.0] com_ajax do not work with namespaced module"
or something in this way.
This is a Release Blocker
cc @richard67
Title |
|
Labels |
Added:
J4 Issue
?
|
Build | J 4 | ⇒ | 4.0-dev |
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2021-02-03 16:10:53 |
Closed_By | ⇒ | Quy |
Labels |
Removed:
?
|
Hi guys, I know this issue is already closed but is this issue really already solved because the issue is still persist in Joomla 4.0.3. Also, it looks like com_ajax still looks for Mod class prefix in helper class name.
@webchun check https://github.com/dgrammatiko/invalidate-cache/tree/main/src/invalidatecache
There are some changes between J3 and J4
@webchun check https://github.com/dgrammatiko/invalidate-cache/tree/main/src/invalidatecache There are some changes between J3 and J4
I din't see that relate with my question can you explain it?
That is namespacing issue.
But can be a problem with com_ajax, I agree.
Either need to fix com_ajax or use dummy helper.php that include MyModuleHelper.php