Page Menu
Home
In-Portal Phabricator
Search
Configure Global Search
Log In
Files
F803943
D10.id124.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Wed, Feb 26, 9:01 AM
Size
1 KB
Mime Type
text/x-diff
Expires
Thu, Feb 27, 9:01 AM (8 h, 2 m)
Engine
blob
Format
Raw Data
Handle
576663
Attached To
D10: INP-1315 - Reset cached sorting on sorting configuration change
D10.id124.diff
View Options
Index: core/units/configuration/configuration_event_handler.php
===================================================================
--- core/units/configuration/configuration_event_handler.php
+++ core/units/configuration/configuration_event_handler.php
@@ -304,6 +304,14 @@
// update value in cache, so other code (during this script run) would use new value
$this->Application->SetConfigValue($variable_name, $object->GetDBField('VariableValue'), true);
+
+ $sorting_prefix = $this->getSortingPrefix($variable_name);
+
+ if ( $sorting_prefix ) {
+ $sql = 'DELETE FROM ' . TABLE_PREFIX . 'UserPersistentSessionData
+ WHERE VariableName LIKE "' . $sorting_prefix . '%Sortings.%"';
+ $this->Conn->Query($sql);
+ }
}
if ( $variable_name == 'Require_AdminSSL' || $variable_name == 'AdminSSLDomain' ) {
@@ -323,6 +331,35 @@
}
/**
+ * Returns prefix, related to given sorting system setting
+ *
+ * @param string $system_setting System setting.
+ *
+ * @return boolean|string
+ */
+ protected function getSortingPrefix($system_setting)
+ {
+ foreach ( $this->Application->ModuleInfo as $module_info ) {
+ if ( $module_info['Name'] == 'In-Portal' ) {
+ continue;
+ }
+
+ $prefix = ($module_info['Var'] == 'adm') ? 'c' : $module_info['Var'];
+ $config_mapping = $this->Application->getUnitConfig($prefix)->getConfigMapping();
+
+ if ( (isset($config_mapping['DefaultSorting1Field'])
+ && $system_setting == $config_mapping['DefaultSorting1Field'])
+ || (isset($config_mapping['DefaultSorting2Field'])
+ && $system_setting == $config_mapping['DefaultSorting2Field'])
+ ) {
+ return $prefix;
+ }
+ }
+
+ return false;
+ }
+
+ /**
* Updates kDBItem
*
* @param kEvent $event
Event Timeline
Log In to Comment