? Pending

User tests: Successful: Unsuccessful:

avatar kavadas
kavadas
27 Jun 2016

Summary of Changes

JFormFieldUser is using the JTableUser directly and not the JFactory::getUser. This can generate duplicate queries in case multiple fields are rendered with the same value/user id.

Testing Instructions

Enable the system debugger and try to edit one article which has the same value for "created_by" and "modified_by" fields. When the edit page is loaded, look at the debugger and you will see duplicate queries coming from JFormFieldUser. With the patch applied you should see no duplicate queries from JFormFieldUser.

avatar kavadas kavadas - open - 27 Jun 2016
avatar kavadas kavadas - change - 27 Jun 2016
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 27 Jun 2016
Labels Added: ?
avatar kavadas kavadas - change - 27 Jun 2016
The description was changed
avatar mbabker
mbabker - comment - 27 Jun 2016

Might I suggest using JUser::getInstance() instead of JFactory::getUser() as the latter will always load a user instance out of the session before going on to call JUser::getInstance() anyway. The instance caching is in JUser so there's only small gains to be had here.

avatar brianteeman brianteeman - change - 27 Jun 2016
Category Fields Libraries
avatar kavadas
kavadas - comment - 28 Jun 2016

@mbabker

I have updated the code. However when the field value is set to current user JFactory::getUser() is still used.

avatar mbabker
mbabker - comment - 28 Jun 2016

That'd be totally appropriate. Looks fine to me.

avatar hardiktailored hardiktailored - test_item - 11 Jul 2016 - Tested successfully
avatar hardiktailored
hardiktailored - comment - 11 Jul 2016

I have tested this item successfully on 1ed139a


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/10945.

avatar gunjanpatel gunjanpatel - test_item - 14 Jul 2016 - Tested successfully
avatar gunjanpatel
gunjanpatel - comment - 14 Jul 2016

I have tested this item successfully on 1ed139a

Before 52 queries and 16 duplicates, after patch it's 48 queries and 12 duplicates. Thanks.


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/10945.

avatar gunjanpatel gunjanpatel - change - 14 Jul 2016
Status Pending Ready to Commit
avatar gunjanpatel
gunjanpatel - comment - 14 Jul 2016

RTC


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/10945.

avatar joomla-cms-bot joomla-cms-bot - change - 14 Jul 2016
Labels Added: ?
avatar roland-d roland-d - close - 16 Jul 2016
avatar roland-d roland-d - merge - 16 Jul 2016
avatar joomla-cms-bot joomla-cms-bot - close - 16 Jul 2016
avatar roland-d roland-d - change - 16 Jul 2016
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2016-07-16 14:46:01
Closed_By roland-d
avatar joomla-cms-bot joomla-cms-bot - change - 16 Jul 2016
Labels Removed: ?

Add a Comment

Login with GitHub to post a comment