? Success

User tests: Successful: Unsuccessful:

avatar Fedik
Fedik
27 Feb 2014

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 :smile:

Joomla! Issue Tracker [#33353] JUcmContent/base getType() should return same instance

avatar Fedik Fedik - open - 27 Feb 2014
avatar Bakual
Bakual - comment - 27 Feb 2014

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.

avatar Fedik
Fedik - comment - 27 Feb 2014

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 :smile:

avatar wilsonge
wilsonge - comment - 26 Jul 2014

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

avatar nicksavov nicksavov - change - 21 Aug 2014
Labels Removed: ?
avatar nicksavov nicksavov - change - 21 Aug 2014
Title
JUcmContent/base getType() should return same instance
[#33353] JUcmContent/base getType() should return same instance
avatar Fedik Fedik - change - 21 Aug 2014
Title
JUcmContent/base getType() should return same instance
[#33353] JUcmContent/base getType() should return same instance
avatar brianteeman brianteeman - change - 21 Sep 2014
Category Libraries
avatar brianteeman brianteeman - change - 21 Sep 2014
Status New Pending
avatar wilsonge wilsonge - close - 17 Mar 2015
avatar wilsonge
wilsonge - comment - 17 Mar 2015

Closed in favour of #6466 which is the same thing but without the constructor codestyle change I asked to be reverted

avatar wilsonge wilsonge - change - 17 Mar 2015
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2015-03-17 00:55:20
avatar wilsonge wilsonge - close - 17 Mar 2015
avatar Fedik Fedik - head_ref_deleted - 24 Mar 2015

Add a Comment

Login with GitHub to post a comment