Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error listing view - make details column unsortable #1444

Merged
merged 1 commit into from
Sep 19, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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