forked from joomla/joomla-platform
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix static variable caching of instances causing infinite nesting
in JForm, joomla#1354
- Loading branch information
Showing
1 changed file
with
1 addition
and
7 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
993426d
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.
We moved all of those instance holding variables outside the method scope so classes overriding the getInstance() method still have access to it, nut sure if it's worth loosing that.
Also that code looks incorrect, aren't you resetting $forms to an empty array with each instance you create?
993426d
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.
It works the same as with class variables, they are initialized only once, see joomla#5 here http://www.php.net/manual/en/language.variables.scope.php#language.variables.scope.static