Skip to content
Permalink
Browse files

Add plugin filters management in search.php

Before modification, filters created through plugins (using MantisFilter
class and EVENT_FILTER_FIELDS hook) cannot be used in "Permalink"
functionality.

Now, the data about filters mapped by EVENT_FILTER_FIELDS hook are
managed by search.php witch is used to analyse permanent links.

Fixes #25072
  • Loading branch information...
elpoutro authored and dregad committed Dec 17, 2018
1 parent 95657a7 commit a759e186f1f7b0e1f07a182b454131e8b5e6d020
Showing with 22 additions and 0 deletions.
  1. +22 −0 search.php
@@ -142,6 +142,28 @@
$t_my_filter['custom_fields'] = $t_custom_fields;
# Handle class-based filters defined as plugins
$t_plugin_filters = filter_get_plugin_filters();
foreach( $t_plugin_filters as $t_field_name => $t_filter_object ) {
switch( $t_filter_object->type ) {
case FILTER_TYPE_STRING:
$t_my_filter[$t_field_name] = gpc_get_string( $t_field_name, $t_meta_filter_any_array[$t_field_name] );
break;
case FILTER_TYPE_INT:
$t_my_filter[$t_field_name] = gpc_get_int( $t_field_name, $t_meta_filter_any_array[$t_field_name] );
break;
case FILTER_TYPE_BOOLEAN:
$t_my_filter[$t_field_name] = gpc_get_bool( $t_field_name, $t_meta_filter_any_array[$t_field_name]);
break;
case FILTER_TYPE_MULTI_STRING:
$t_my_filter[$t_field_name] = gpc_get_string_array( $t_field_name, $t_meta_filter_any_array[$t_field_name] );
break;
case FILTER_TYPE_MULTI_INT:
$t_my_filter[$t_field_name] = gpc_get_int_array( $t_field_name, $t_meta_filter_any_array[$t_field_name] );
break;
}
}
# Must use advanced filter so that the project_id is applied and multiple
# selections are handled.
$t_my_filter['_view_type'] = FILTER_VIEW_TYPE_ADVANCED;

0 comments on commit a759e18

Please sign in to comment.
You can’t perform that action at this time.