? Pending
Related to # 14440

User tests: Successful: Unsuccessful:

avatar ggppdk
ggppdk
9 Jun 2018

Pull Request for Issue #20698
Better alternative to the closed PR #20697, @mbabker , i hope it is ok to ping you to review this

Summary of Changes

Modified method __wakeup() (class Joomla\CMS\User\User)
-- which is called when unserialize() is called on the JUser object
so that it does not reload user record from DB

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 mbabker
mbabker - comment - 9 Jun 2018

Again, I don't think we absolutely need to remove these duplicate queries. What is the real issue it is trying to address, other than having multiple of the same query being executed in one cycle? We do a partial serialization of the User object (only the ID), so when unserialized the rest of the data has to be pulled in somehow. The User object is a data object representing a record from the database, any time it is instantiated (which includes the unserialization process) it really should be fresh data.

Duplicate queries in and of themselves are not a bug or concern. Why you have duplicates is more important. I don't really see "reading user data out of the session into a User object creates duplicate queries" as a concern and I honestly think if we're going to strive for a "no duplicate queries ever" policy we're going to introduce some bad code to the CMS.

avatar Quy
Quy - comment - 10 Jun 2018

Related #14440

96f2399 17 Jun 2018 avatar ggppdk CS
avatar ggppdk ggppdk - change - 17 Jun 2018
Labels Added: ?
avatar franz-wohlkoenig franz-wohlkoenig - change - 2 Jul 2018
Rel_Number 0 14440
Relation Type Related to
avatar ggppdk
ggppdk - comment - 16 Jul 2018

Thanks anyone spending time on this,
anyway this is not needed

avatar ggppdk ggppdk - change - 16 Jul 2018
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2018-07-16 05:37:51
Closed_By ggppdk
avatar ggppdk ggppdk - close - 16 Jul 2018

Add a Comment

Login with GitHub to post a comment