Skip to content

Commit

Permalink
Merge pull request #1444 from Automattic/update/1361-unsortable-detai…
Browse files Browse the repository at this point in the history
…ls-column

Error listing view - make details column unsortable
  • Loading branch information
westonruter authored Sep 19, 2018
2 parents 9444a75 + 5bcd71b commit 3bed87c
Showing 1 changed file with 0 additions and 16 deletions.
16 changes: 0 additions & 16 deletions includes/validation/class-amp-validation-error-taxonomy.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,6 @@ class AMP_Validation_Error_Taxonomy {
*/
const VALIDATION_ERROR_TYPE_QUERY_VAR = 'amp_validation_error_type';

/**
* Query var used for ordering list by node name.
*
* @var string
*/
const VALIDATION_DETAILS_NODE_NAME_QUERY_VAR = 'amp_validation_node_name';

/**
* Query var used for ordering list by error code.
*
Expand Down Expand Up @@ -653,7 +646,6 @@ public static function add_admin_hooks() {
add_filter( 'manage_edit-' . self::TAXONOMY_SLUG . '_sortable_columns', function( $sortable_columns ) {
$sortable_columns['created_date_gmt'] = 'term_id';
$sortable_columns['error_type'] = AMP_Validation_Error_Taxonomy::VALIDATION_ERROR_TYPE_QUERY_VAR;
$sortable_columns['details'] = AMP_Validation_Error_Taxonomy::VALIDATION_DETAILS_NODE_NAME_QUERY_VAR;
$sortable_columns['error'] = AMP_Validation_Error_Taxonomy::VALIDATION_DETAILS_ERROR_CODE_QUERY_VAR;
return $sortable_columns;
} );
Expand Down Expand Up @@ -820,7 +812,6 @@ public static function add_order_clauses_from_description_json() {

$sortable_column_vars = array(
self::VALIDATION_ERROR_TYPE_QUERY_VAR,
self::VALIDATION_DETAILS_NODE_NAME_QUERY_VAR,
self::VALIDATION_DETAILS_ERROR_CODE_QUERY_VAR,
);

Expand All @@ -846,13 +837,6 @@ public static function add_order_clauses_from_description_json() {
);
break;

case AMP_Validation_Error_Taxonomy::VALIDATION_DETAILS_NODE_NAME_QUERY_VAR:
$clauses['orderby'] = $wpdb->prepare(
'ORDER BY SUBSTR(tt.description, LOCATE(%s, tt.description))',
'"node_name":"'
);
break;

case AMP_Validation_Error_Taxonomy::VALIDATION_DETAILS_ERROR_CODE_QUERY_VAR:
$clauses['orderby'] = $wpdb->prepare(
'ORDER BY SUBSTR(tt.description, LOCATE(%s, tt.description))',
Expand Down

0 comments on commit 3bed87c

Please sign in to comment.