Matthias Mullie has submitted this change and it was merged.

Change subject: Defer the User::saveSettings() call in TopicListBlock
......................................................................


Defer the User::saveSettings() call in TopicListBlock

Bug: T92357
Change-Id: I40c590346c2634f2c35271e813e68d4a6ae70836
---
M includes/Block/TopicList.php
1 file changed, 4 insertions(+), 1 deletion(-)

Approvals:
  Catrope: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/Block/TopicList.php b/includes/Block/TopicList.php
index cbbcebd..e4d4569 100644
--- a/includes/Block/TopicList.php
+++ b/includes/Block/TopicList.php
@@ -424,7 +424,10 @@
                        && $user->getOption( 'flow-topiclist-sortby' ) != 
$findOptions['sortby']
                ) {
                        $user->setOption( 'flow-topiclist-sortby', 
$findOptions['sortby'] );
-                       $user->saveSettings();
+                       // Save the user preferences post-send
+                       \DeferredUpdates::addCallableUpdate( function() use ( 
$user ) {
+                               $user->saveSettings();
+                       } );
                }
 
                return $findOptions;

-- 
To view, visit https://gerrit.wikimedia.org/r/239764
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I40c590346c2634f2c35271e813e68d4a6ae70836
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/Flow
Gerrit-Branch: master
Gerrit-Owner: Aaron Schulz <[email protected]>
Gerrit-Reviewer: Catrope <[email protected]>
Gerrit-Reviewer: Matthias Mullie <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to