Conversation
1af9414 to
f8a5255
Compare
f8a5255 to
8f2114f
Compare
|
My eyes still hurt from editing ajax.php! |
|
I've looked into changes and I think it looks solid. |
|
@SharkyKZ why downvote? |
02f4b48 to
9fdbace
Compare
|
I understand you... |
|
It is working as described. However, there are few things:
$results = new LogicException(Text::sprintf('COM_AJAX_METHOD_NOT_EXISTS', $method . 'Ajax'), 404);
if ($results === null && $moduleId && $table->load($moduleId) && $table->enabled)I won't comment about the architecture change here because I'm not good at it and still trying to get myself familiar with architecture changes in J4. |
|
@joomdonation please comment inline in the code. Easier to understand. |
components/com_ajax/ajax.php
Outdated
| } | ||
| if ($moduleInstance instanceof \Joomla\CMS\Helper\HelperFactoryInterface && $helper = $moduleInstance->getHelper($class)) | ||
| { | ||
| $results = $helper->{$method . 'Ajax'}(); |
There was a problem hiding this comment.
Here, you call the method without check and make sure that the method exists before calling (like what we do with none namespace helper module https://github.com/joomla/joomla-cms/blob/4.0-dev/components/com_ajax/ajax.php#L99)
You also do not check and make sure the module is enabled, like what we are doing here https://github.com/joomla/joomla-cms/blob/4.0-dev/components/com_ajax/ajax.php#L64 for none namespace module
There was a problem hiding this comment.
Can you have another look, restored most of the ajax.php stuff and now the boot call is inside the checks.
|
I have tested this item ✅ successfully on 50828d9 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/32633. |
1 similar comment
|
I have tested this item ✅ successfully on 50828d9 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/32633. |
|
RTC This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/32633. |
Pull Request for pr #32291.
Summary of Changes
All over joomla are helpers manually loaded. Better to load them through a factory from the booted extension.
Testing Instructions
Actual result BEFORE applying this Pull Request
{"success":true,"message":null,"messages":null,"data":["test"]}Expected result AFTER applying this Pull Request
{"success":false,"message":"The file at mod_quickIcon\/helper.php does not exist.","messages":null,"data":null}Documentation Changes Required
Should be documented on the same place where the new extension setup is documented.