-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes Joomla 3.1.4 compatibility issue (#39)
- Loading branch information
Showing
1 changed file
with
21 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9349c5b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changing these two items to protected instead of private will fix the issue as well.
9349c5b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dongilbert Yes, but only for Joomla 3.1.4, correct? I also want my extension to be able to run on Joomla 2.5 without change.
And $db doesn't refer to the plain db connection, but a custom type handling my db stuff...
9349c5b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The error on 3.1.2+ is due to a new feature that will auto-populate your $app and $db properties in a plugin. When I made that feature and submitted the patch, I didn't take into account that some plugins may already have these properties, and that they could be set to private instead of an accessible visibility. If you set them to protected, it will still work on 2.5, and the fatal error will go away in 3.1.2+.
We're pushing a 3.1.5 release tonight (?) that fixes this by checking visibility on the properties before doing anything.
Ideally, a plugin would set those properties in the constructor. You could do it like this and work in all versions 2.5+
With that in place, you're variables will be what you set them as, and not be overwritten, as the feature doesn't touch the variables if they are already set.