Skip to content

Commit

Permalink
Deprecate old filter api functions
Browse files Browse the repository at this point in the history
  • Loading branch information
cproensa authored and dregad committed Mar 5, 2018
1 parent 5f5a0c4 commit 5aff332
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions core/filter_api.php
Expand Up @@ -1074,8 +1074,12 @@ function filter_get_field( $p_filter_id, $p_field_name ) {
* @param boolean $p_show_sticky Whether to show sticky items.
* @param array $p_query_clauses Array of query clauses.
* @return array $p_query_clauses
*
* @deprecated Use BugFilterQuery class
*/
function filter_get_query_sort_data( array &$p_filter, $p_show_sticky, array $p_query_clauses ) {
error_parameters( __FUNCTION__ . '()', 'BugFilterQuery class' );
trigger_error( ERROR_DEPRECATED_SUPERSEDED, DEPRECATED );

$p_query_clauses['order'] = array();

Expand Down Expand Up @@ -1231,8 +1235,13 @@ function filter_get_query_sort_data( array &$p_filter, $p_show_sticky, array $p_
* array_unique here could cause problems with the query.
* @param array $p_query_clauses Array of query clauses.
* @return array
*
* @deprecated Use BugFilterQuery class
*/
function filter_unique_query_clauses( array $p_query_clauses ) {
error_parameters( __FUNCTION__ . '()', 'BugFilterQuery class' );
trigger_error( ERROR_DEPRECATED_SUPERSEDED, DEPRECATED );

$p_query_clauses['select'] = array_unique( $p_query_clauses['select'] );
$p_query_clauses['from'] = array_unique( $p_query_clauses['from'] );
$p_query_clauses['join'] = array_unique( $p_query_clauses['join'] );
Expand All @@ -1249,8 +1258,15 @@ function filter_unique_query_clauses( array $p_query_clauses ) {
* @param array $p_query_clauses Array of query clauses.
* @param boolean $p_pop_param Whether to pop DB params from the stack
* @return integer
*
* @deprecated Use BugFilterQuery class
*/
function filter_get_bug_count( array $p_query_clauses, $p_pop_param = true ) {
error_parameters( __FUNCTION__ . '()', 'BugFilterQuery class' );
trigger_error( ERROR_DEPRECATED_SUPERSEDED, DEPRECATED );

error_parameters( __FUNCTION__ . '()', 'BugFilterQuery class' );
trigger_error( ERROR_DEPRECATED_SUPERSEDED, DEPRECATED );
# If query caluses is an empty array, the query can't be created
if( empty( $p_query_clauses ) ) {
if( $p_pop_param ) {
Expand Down Expand Up @@ -1384,8 +1400,13 @@ function filter_get_bug_rows_filter( $p_project_id = null, $p_user_id = null ) {
* -1 or null indicates default query (no offset)
* @param boolean $p_pop_param Whether to pop DB params from the stack
* @return IteratorAggregate|boolean adodb result set or false if the query failed.
*
* @deprecated Use BugFilterQuery class
*/
function filter_get_bug_rows_result( array $p_query_clauses, $p_count = null, $p_offset = null, $p_pop_param = true ) {
error_parameters( __FUNCTION__ . '()', 'BugFilterQuery class' );
trigger_error( ERROR_DEPRECATED_SUPERSEDED, DEPRECATED );

# if the query can't be formed, there are no results
if( empty( $p_query_clauses ) ) {
if( $p_pop_param ) {
Expand Down Expand Up @@ -1440,8 +1461,13 @@ function filter_get_bug_rows_result( array $p_query_clauses, $p_count = null, $p
* @param integer $p_user_id User id to use as current user when filtering.
* @param boolean $p_show_sticky True/false - get sticky issues only.
* @return array
*
* @deprecated Use BugFilterQuery class
*/
function filter_get_bug_rows_query_clauses( array $p_filter, $p_project_id = null, $p_user_id = null, $p_show_sticky = null ) {
error_parameters( __FUNCTION__ . '()', 'BugFilterQuery class' );
trigger_error( ERROR_DEPRECATED_SUPERSEDED, DEPRECATED );

log_event( LOG_FILTERING, 'START NEW FILTER QUERY' );

$t_limit_reporters = config_get( 'limit_reporters' );
Expand Down

0 comments on commit 5aff332

Please sign in to comment.