Page MenuHomeIn-Portal Phabricator

D10.id143.diff
No OneTemporary

File Metadata

Created
Wed, Feb 26, 9:02 AM

D10.id143.diff

Index: branches/5.3.x/core/units/configuration/configuration_event_handler.php
===================================================================
--- branches/5.3.x/core/units/configuration/configuration_event_handler.php
+++ branches/5.3.x/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