Success

User tests: Successful: Unsuccessful:

avatar dongilbert
dongilbert
22 Jun 2013

I find my self many times overriding the constructor in my plugins simply to add a reference to $this->app and $this->db for easy access to the application object and the database object within my plugin methods. The proposed update takes care of this by adding a bit of magic to the JPlugin constructor. It checks to see if the app and db properties exist within your plugin class, and if they do (and are null) it will set them to JFactory::getApplication() and JFactory::getDbo() automatically.

It's a minor change, but it makes J! programming that easier.

Feature Tracker Item: http://joomlacode.org/gf/project/joomla/tracker/?action=TrackerItemEdit&tracker_item_id=31205

avatar dongilbert dongilbert - open - 22 Jun 2013
avatar nikosdion
nikosdion - comment - 22 Jun 2013

+1 The code is very straightforward and actually makes plugins (more) testable without introducing any backwards compatibility issues.

avatar b2z
b2z - comment - 23 Jun 2013

Simple and useful :+1:

avatar dongilbert
dongilbert - comment - 24 Jun 2013

Thanks for adding the UT's for this Michael.

avatar betweenbrain
betweenbrain - comment - 24 Jun 2013

Is this good to merge then?

avatar dongilbert
dongilbert - comment - 24 Jun 2013

I hope so. :+1:

avatar betweenbrain
betweenbrain - comment - 8 Jul 2013

From everything I see, this seems good to merge. Does it need more testing?

avatar mbabker
mbabker - comment - 8 Jul 2013

It's in Ready for Review status, meaning it's waiting for a(nother) PLT member to review it and accept or reject. It can't be me due to contributing code for this.

avatar betweenbrain
betweenbrain - comment - 8 Jul 2013

Thanks for clarifying. Hopefully it will be merged before it encounters
merge conflicts and needs to be redone. It's a nice improvement.

Best,

Matt Thomas
Founder betweenbrain http://betweenbrain.com/
Lead Developer Construct Template Development
Frameworkhttp://construct-framework.com/
Phone: 203.632.9322
Twitter: @betweenbrain
Github: https://github.com/betweenbrain

On Mon, Jul 8, 2013 at 9:42 AM, Michael Babker notifications@github.comwrote:

It's in Ready for Review status, meaning it's waiting for a(nother) PLT
member to review it and accept or reject. It can't be me due to
contributing code for this.


Reply to this email directly or view it on GitHub#1321 (comment)
.

avatar dongilbert
dongilbert - comment - 21 Jul 2013

Status changed to accepted on the tracker, so hopefully that means it'll make it for 3.1.2!

avatar dongilbert
dongilbert - comment - 22 Jul 2013

Merged via ee7ac38

avatar dongilbert dongilbert - close - 22 Jul 2013

Add a Comment

Login with GitHub to post a comment