Skip to content

[4.0] Helper.file path convention for modules #32136

@webchun

Description

@webchun

Steps to reproduce the issue

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';

System information (as much as possible)

Joomla 4 Beta 5

Additional comments

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions