joomla/joomla-cms — pull request #3945 by Bakual (2014-07-22 18:36:50+00:00)
Title: Fixing $query->setLimit

This should fix the issue raised with https://github.com/joomla/joomla-cms/issues/3940

Currently, `$query->setLimit()` is overriden by `$db->query()`. Making the method kind of useless.

This PR will make it so that `setQuery` checks if there is a limit or offset property set in the `$query` and uses that one if it's set and `setQuery` doesn't have an own value set already.

To test you can use the Ajax example plugin like described in the original Issue:
* Download https://github.com/Joomla-Ajax-Interface/Ajax-Latest-Articles/archive/875f1f4348b1e856539360dea4317097689db2c7.zip
* Install the plugin
* Use the URL `index.php?option=com_ajax&plugin=latestarticles&format=debug`
* Verify that the response from the plugin respects the parameter.