-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[#32146] com_ajax: improvement, use controllers, better error handling #2107
Conversation
What are reasons behind own Overall this feels much more right than current implementation |
|
I have to say I'm not a massive fan of this. In this specific case I think splitting it up is creating more hassle than it's worth. I'm of the opinion for modules and plugins pretty much all we should support is json replies - and maybe raw if we are in debug mode. This seems like creating files for the sake of conforming to standards. I support moving to JResponseJson (as in piotr's PR) but I think that's as far as we need to go. I'd say this component will get removed as soon as we move to webservices (J5??) anyhow |
If we are going to do controllers let's do them new style for example just calll or callplugin, callmodule with options for format (and maybe even with options for plugin or module). The new style is designed for services and makes a lot more sense. Also use singular folder names so things autoload correctly and we don't need to mess around with includes. |
@elinw there already I know not to much about planed web-services, so I thought that extending the current realization by adding just a new controller in future, will be a cool idea ;) and think, right, if do it compatible with web-services, then the current "trick" can be removed with the less pain in future when web-services will be ready ... but I know nothing about the plans around web-services :) |
I appreciate the work that went into this PR, the code is well written and has some nice innovations like |
I really see no problem with formats example for |
@Fedik Yes, you can do it in your own installation, but what about if you'd like to use formats like |
answer is:
it can be added without big problem if it will be a really need ;) but combination |
ok, added |
Would it be safe to say that we can close this issue as there isn't consensus to the changes it introduces? |
Conflicts: components/com_ajax/ajax.php
ok, changed to using new MVC, thoughts? :) |
Conflicts: components/com_ajax/ajax.php
new pull to staging #3071 |
can be a bit late, but but...
this pull request change the com_ajax to work in Joomla! way, using new MVC
and work like described http://docs.joomla.org/Xml-rpc_changes_in_Joomla!_1.6here each format have a own controller and each "element" (plugin, module) have own controller.It allow more simple extend this component in future, if will be needcall link changed to:for plugins:index.php?option=com_ajax&task=plugin.call&name=foo&format=json
index.php?option=com_ajax&task=plugin.call&name=foo&format=raw
for modules:index.php?option=com_ajax&task=module.call&name=foo&format=json
index.php?option=com_ajax&task=module.call&name=foo&format=raw
Another formats we can add in future, by request.
Other changes:
format
parameter now is requiredcontent
andsystem
plugin groupslinks: