? ? Pending

User tests: Successful: Unsuccessful:

avatar laoneo
laoneo
10 Mar 2021

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

  • Open the dashboard.
  • Add the following code to the file administrator/modules/mod_quickicon/src/Helper/QuickIconHelper.php:
public static function getDataAjax()
{
	$data = ['test'];

	return $data;
}
  • Open the url /administrator/index.php?option=com_ajax&module=quickIcon&method=getData&format=json

Actual result BEFORE applying this Pull Request

  • Icons are loaded.
  • Ajax url shows {"success":true,"message":null,"messages":null,"data":["test"]}

Expected result AFTER applying this Pull Request

  • Icons are loaded.
  • Ajax url shows {"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.

Votes

# of Users Experiencing Issue
0/1
Average Importance Score
5.00

avatar laoneo laoneo - open - 10 Mar 2021
avatar laoneo laoneo - change - 10 Mar 2021
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 10 Mar 2021
Category Modules Administration Front End com_ajax Libraries
avatar laoneo laoneo - change - 10 Mar 2021
Labels Added: ?
avatar laoneo
laoneo - comment - 10 Mar 2021

My eyes still hurt from editing ajax.php!

avatar thednp
thednp - comment - 10 Mar 2021

I've looked into changes and I think it looks solid.

avatar laoneo
laoneo - comment - 10 Mar 2021

@SharkyKZ why downvote?

avatar thednp
thednp - comment - 11 Mar 2021

Since my #30816 was pushed for 4.1, all of a sudden my interest in this dropped.

@thednp if we can bring #32633 somehow to fly, then the same pattern can be applied to templates.

I don't see that comin any time soon this year.

avatar laoneo
laoneo - comment - 11 Mar 2021

I understand you...

avatar joomdonation
joomdonation - comment - 14 Mar 2021

It is working as described. However, there are few things:

  • You do not validate and make sure the method exists before calling the method. For legacy module, we throws LogicException
$results = new LogicException(Text::sprintf('COM_AJAX_METHOD_NOT_EXISTS', $method . 'Ajax'), 404);
  • Look like you bypass the extension enabled check like in the legacy module:
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.

avatar laoneo
laoneo - comment - 17 Mar 2021

@joomdonation please comment inline in the code. Easier to understand.
@wilsonge do we need here also the release blocker label as the previous one had it?

avatar laoneo laoneo - change - 22 Mar 2021
Labels Added: ?
avatar dgrammatiko dgrammatiko - test_item - 24 Mar 2021 - Tested successfully
avatar dgrammatiko
dgrammatiko - comment - 24 Mar 2021

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.

avatar jwaisner jwaisner - test_item - 25 Mar 2021 - Tested successfully
avatar jwaisner
jwaisner - comment - 25 Mar 2021

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.

avatar jwaisner jwaisner - change - 25 Mar 2021
Status Pending Ready to Commit
avatar jwaisner
jwaisner - comment - 25 Mar 2021

RTC


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/32633.

avatar rdeutz rdeutz - change - 25 Mar 2021
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2021-03-25 14:38:07
Closed_By rdeutz
Labels Added: ?
Removed: ?
avatar rdeutz rdeutz - close - 25 Mar 2021
avatar rdeutz rdeutz - merge - 25 Mar 2021

Add a Comment

Login with GitHub to post a comment