User tests: Successful: Unsuccessful:
Pull Request for Issue # .
There's an inconsistency in the com_ajax logic that prevents modules resolving correctly the Helper file (read the testing instructions below). The proposed fix is to use a strtolower
for the db name of the module and let the other parts intact...
To experience the bug you need to edit the file administrator/modules/mod_guidedtours/src/Helper/GuidedToursHelper.php
and add on function named toursAjax
ie:
public function toursAjax()
{
return ["success" => true, "message" => "in a bottle"];
}
Then in the cpanel open the browser console and run
await fetch(new URL(`${Joomla.getOptions('system.paths').baseFull}index.php?option=com_ajax&module=guidedtours&method=tours&format=json`), { headers: { 'X-CSRF-Token': Joomla.getOptions('csrf.token') } }).then(x => x.json())
Note: the part module=guidedtours
(prefixed with mod_
) reflects the column element
in the #__extensions
table.
The result is that the com_ajax will Look for a GuidedtoursHelper
class, which will fail on any case sensitive filesystem:
Apply the PR and run in the console the following (observe that the module now is defined as GuidedTours
)
await fetch(new URL(`${Joomla.getOptions('system.paths').baseFull}index.php?option=com_ajax&module=GuidedTours&method=tours&format=json`), { headers: { 'X-CSRF-Token': Joomla.getOptions('csrf.token') } }).then(x => x.json())
The class is correctly identified as GuidedToursHelper
Please select:
Documentation link for docs.joomla.org:
No documentation changes for docs.joomla.org needed
Pull Request link for manual.joomla.org:
No documentation changes for manual.joomla.org needed
Category | ⇒ | Front End com_ajax |
Status | New | ⇒ | Pending |
Could you check if you can reproduce my finding?
Are you on a case sensitive filesystem?
Could you check if you can reproduce my finding?
Are you on a case sensitive filesystem?
Server is Ubuntu, so yes.
Status | Pending | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2023-05-14 13:11:29 |
Closed_By | ⇒ | dgrammatiko | |
Labels |
Added:
PR-4.3-dev
|
Maybe this is also a combo with DB/PHP. I've had complains for 2 cases https://github.com/dgrammatiko/invalidate-cache and https://github.com/dgrammatiko/mod_child_export and I end up renaming the helper class.
Anyways, I'll close for now. Thanks for checking
@dgrammatiko Maybe I made some mistake when testing? I did everything as described, but who knows.
@dgrammatiko I have tested, but in opposite to your testing instructions I have tested both cases
&module=guidedtours
and&module=GuidedTours
without and with the PR.I've not seen any difference.
The
&module=guidedtours
returns the object with success=false and the message that the helper was not found, and the&module=GuidedTours
returns your message in a bottle with success=true, regardless if I have the change from this PR applied or not.Could you check if you can reproduce my finding?