? Pending

User tests: Successful: Unsuccessful:

avatar ggppdk
ggppdk
9 Jun 2018

Pull Request for Issue #20698

Summary of Changes

Cache JTable records loaded by JUser class (Joomla\CMS\User\User)

Testing Instructions

  1. Enable DEBUG in global configuration
  2. Visit Control Panel screen

Expected result

Show only 2 duplicates queries

  • without any duplicate queries to DB Tables: __users , __usergroups

Actual result

6 duplicates queries are reported

  • 2 of them to __users DB Table
  • 2 of them to __usergroups DB Table

Documentation Changes Required

None

avatar ggppdk ggppdk - open - 9 Jun 2018
avatar ggppdk ggppdk - change - 9 Jun 2018
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 9 Jun 2018
Category Libraries
avatar ggppdk ggppdk - change - 9 Jun 2018
The description was changed
avatar ggppdk ggppdk - edited - 9 Jun 2018
avatar mbabker
mbabker - comment - 9 Jun 2018

To be honest I don't know what to think of this. JTable::load() doesn't cache, anything relying on it shouldn't either. If you're loading a record fresh from the database in this way you don't want cached data, especially if the data changes during the request cycle after what puts the record in the cache. Additionally, there is no way to force bust cache.

Duplicate queries in and of itself is not an issue. Why you get duplicate queries is a bigger issue.

avatar ggppdk
ggppdk - comment - 9 Jun 2018

Yes
i was wondering if these queries should be cached or not
and i can not say that i am sure of this PR,

plus it is not like that one would duplicate same user (via new JUser and load it) inside a loop or anything similar
so i ll close this

still it would be nice to remove these "duplicates queries" from showing up in the debug report

avatar ggppdk ggppdk - change - 9 Jun 2018
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2018-06-09 06:13:18
Closed_By ggppdk
Labels Added: ?
avatar ggppdk ggppdk - close - 9 Jun 2018
avatar ggppdk ggppdk - change - 9 Jun 2018
The description was changed
avatar ggppdk ggppdk - edited - 9 Jun 2018

Add a Comment

Login with GitHub to post a comment