User tests: Successful: Unsuccessful:
getType() should return same Type instance instead of make new each time
not very know how to test it, but for me it obvious mistake
Joomla! Issue Tracker [#33353] JUcmContent/base getType() should return same instance
sorry forgot to add the tracker link, fixed
I found it used on save the Article with Tags, I think it used only for initialise Type instance on JUcmBase __construct, but not sure
I think it can make some hidden bugs, because if you do
$ucm = new JUcmBase('alias', $type_istance);
//and then
$ucm->getType()
it will return new instance each time.
so I think getType()
should be protected
or should return same instance,
and as I have no idea where it used in Joomla, I made second thing
I agree with this fix. However I disagree with the change made in the constructor in JUcmBase (obviously calling the parent method is correct in the subclass). The thing we have now is much clearer
Labels |
Removed:
?
|
Title |
|
Title |
|
Category | ⇒ | Libraries |
Status | New | ⇒ | Pending |
Status | Pending | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2015-03-17 00:55:20 |
Is there always the same type requested on a pageload? Or what happens if a page needs multiple types?
I'm not sure where this is used exactly, so you at least have to provide an issue (like repeatingly calling same getType($alias) ) where we can test it.
Also a tracker item would be needed.