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.
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.
Might I suggest using
JUser::getInstance()
instead ofJFactory::getUser()
as the latter will always load a user instance out of the session before going on to callJUser::getInstance()
anyway. The instance caching is inJUser
so there's only small gains to be had here.