Page MenuHomeIn-Portal Phabricator

INP-1770 Load default user persistent settings all at once
ClosedPublic

Authored by erik on Jun 5 2019, 10:17 AM.

Details

Summary

optimized default persistent settings usage

Test Plan
  1. Set DBG_REDIRECT debugger setting to 1
  2. Login as root to the adm.console
  3. Go to Catalog & WebsiteLabels & Phrases section
  4. Truncate UserPersistentSessionData table
  5. Change grid sorting to "Modified On"
  6. Confirm, that in debugger shown only 3 select-SQL from UserPersistentSessionData table
  7. Change grid sorting to "Phrase"
  8. Confirm, that in debugger shown only 3 select-SQL from UserPersistentSessionData table
  9. Login as non-root to the adm.console
  10. Go to Catalog & WebsiteLabels & Phrases section
  11. Confirm, that Grid is sorted by "Phrase" column (same as was with root user)
  12. Change grid sorting to "Modified On"
  13. Confirm, that in debugger shown only 3 select-SQL from UserPersistentSessionData table

Diff Detail

Repository
rINP In-Portal
Branch
/in-portal/branches/5.2.x
Lint
Lint ErrorsExcuse: Full file re-formatting is not part of this task.
SeverityLocationCodeMessage
Errorcore/kernel/session/session_storage.php:47PHPCS.E.CodingStandard.Arrays.Array.SpaceAfterKeywordCodingStandard.Arrays.Array.SpaceAfterKeyword
Errorcore/kernel/session/session_storage.php:47PHPCS.E.CodingStandard.Classes.PropertyDeclaration.ScopeMissingCodingStandard.Classes.PropertyDeclaration.ScopeMissing
Errorcore/kernel/session/session_storage.php:47PHPCS.E.CodingStandard.Classes.PropertyDeclaration.VarUsedCodingStandard.Classes.PropertyDeclaration.VarUsed
Errorcore/kernel/session/session_storage.php:47PHPCS.E.CodingStandard.NamingConventions.ValidVariableName.MemberNotCamelCapsCodingStandard.NamingConventions.ValidVariableName.MemberNotCamelCaps
Errorcore/kernel/session/session_storage.php:47PHPCS.E.Generic.PHP.LowerCaseKeyword.FoundGeneric.PHP.LowerCaseKeyword.Found
Errorcore/kernel/session/session_storage.php:47PHPCS.E.Squiz.Commenting.VariableComment.MissingSquiz.Commenting.VariableComment.Missing
Unit
No Unit Test Coverage
Build Status
Buildable 932
Build 932: arc lint + arc unit

Event Timeline

erik created this revision.Jun 5 2019, 10:17 AM
erik requested review of this revision.Jun 5 2019, 10:17 AM
alex requested changes to this revision.Jun 6 2019, 9:47 AM

Also since task does optimization only, then here we should be checking that persistent setting retrieval with/without fallback code works as before (not covered) + verify performed SQL count (covered).

core/kernel/session/session_storage.php
363

according to implementation plan here you should be loading persistent settings of $default_user_id user

This revision now requires changes to proceed.Jun 6 2019, 9:47 AM
erik updated this revision to Diff 908.Jun 6 2019, 12:23 PM

Fixed logic.

erik edited the test plan for this revision. (Show Details)Jun 6 2019, 12:24 PM
alex requested changes to this revision.Jun 7 2019, 2:35 AM
alex added inline comments.
core/kernel/session/session_storage.php
380

please remove (array)


The kDBConnection::GetCol method only returns array (when no results found the array is empty).

This revision now requires changes to proceed.Jun 7 2019, 2:35 AM
erik updated this revision to Diff 909.Jun 7 2019, 5:29 AM
erik edited the test plan for this revision. (Show Details)

Removed excessive (array) typecast.

alex accepted this revision.Jun 7 2019, 10:12 AM
This revision is now accepted and ready to land.Jun 7 2019, 10:12 AM
This revision was landed with ongoing or failed builds.Jan 4 2021, 2:42 AM
This revision was automatically updated to reflect the committed changes.