}
foreach ($formValues as $id => $values) {
+
+ self::legacyConvertFormValues($id, $values);
+
if (self::isAlreadyProcessedForQueryFormat($values)) {
$params[] = $values;
continue;
return $params;
}
+ /**
+ * Function to support legacy format for groups and tags.
+ *
+ * @param string $id
+ * @param array|int $values
+ *
+ */
+ public static function legacyConvertFormValues($id, &$values) {
+ if (in_array($id, array('group', 'tag')) && is_array($values)) {
+ // prior to 4.7, formValues for some attributes (e.g. group, tag) are stored in array(id1 => 1, id2 => 1),
+ // as per the recent Search fixes $values need to be in standard array(id1, id2) format
+ $ids = array_keys($values, 1);
+ if (count($ids) > 1 || (count($ids) == 1 && key($values) > 1)) {
+ $values = $ids;
+ }
+ }
+ }
+
+
/**
* Fix values from query from/to something no-one cared enough to document.
*
'24',
),
),
+ // Include static groups 3 and 5 in legacy format
+ array(
+ 'fv' => array('group' => array('3' => 1, '5' => 1)),
+ 'id' => array(
+ '13',
+ '14',
+ '15',
+ '16',
+ '17',
+ '18',
+ '19',
+ '20',
+ '21',
+ '22',
+ '23',
+ '24',
+ ),
+ ),
// Include tag 7
array(
'fv' => array('tag' => '7'),
),
// Include tag 9
array(
- 'fv' => array('tag' => '9'),
+ 'fv' => array('tag' => array('9' => 1)),
'id' => array(
'10',
'12',