Page Menu
Home
In-Portal Phabricator
Search
Configure Global Search
Log In
Files
F803988
D10.id15.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:03 AM
Size
1 KB
Mime Type
text/x-diff
Expires
Thu, Feb 27, 9:03 AM (4 h, 31 m)
Engine
blob
Format
Raw Data
Handle
576707
Attached To
D10: INP-1315 - Reset cached sorting on sorting configuration change
D10.id15.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,7 +304,15 @@
// 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 == 'AdminSSL_URL' ) {
// when administrative console is moved to SSL mode, then delete skin
@@ -566,5 +574,30 @@
$fields = $config->getFields();
$fields['ModuleOwner']['options'] = $options;
$config->setFields($fields);
+ }
+
+ /**
+ * Returns prefix, related to given sorting system setting
+ *
+ * @param string $system_setting
+ * @return bool|string
+ * @access protected
+ */
+ 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;
}
}
\ No newline at end of file
Event Timeline
Log In to Comment