Sort criteria stopped working recently

Created on 22 September 2020, over 4 years ago
Updated 23 June 2022, over 2 years ago

Recently, I noticed that a custom View (a Block) that I had which used Draggable Weights to sort FlexSlider slideshow items stopped honoring the weighting when sorting the content. I'm fully up-to-date on Drupal Core and installed modules, and can only assume that a recent update of something caused the breakage. This has all been working successfully without any configuration changes to the primary view for several years.

I have a second custom View that serves as a sorting interface which seems to work as always. I can see the weights assigned to my content (optionally), and see that in general I get monotonically increasing numbers assigned to those nodes (starting with "-5"). I recently tweaked this view to allow unpublished content to be included in list, but I wouldn't expect that to have caused problems for the primary block view.

My primary view is constructed nearly identically to the sorting interface in terms of field selection and WHERE-like criteria. Key differences are that the sorting interface includes unpublished nodes, and the primary interface ignores nodes whose start_date value is in the future (>= today).

I'm including here the SQL queries shown in the View edit interface for each of these Views:

Sorting Interface

SELECT node.nid AS nid, node.title AS node_title, node.status AS node_status, 'node' AS field_data_field_link_node_entity_type, 'node' AS field_data_field_display_date_node_entity_type, COALESCE(draggableviews_structure.weight, 2147483647) AS draggableviews_structure_weight_coalesce
FROM {node} node
LEFT JOIN {field_data_field_display_date} field_data_field_display_date ON node.nid = field_data_field_display_date.entity_id AND (field_data_field_display_date.entity_type = 'node' AND field_data_field_display_date.deleted = '0')
LEFT JOIN {draggableviews_structure} draggableviews_structure ON node.nid = draggableviews_structure.entity_id AND draggableviews_structure.view_name = 'masthead_sorting_interface' AND draggableviews_structure.view_display = 'page_1' AND draggableviews_structure.args = '{\"status\":\"All\"}'
WHERE (( (node.type IN  ('masthead_image')) AND (DATE_FORMAT(field_data_field_display_date.field_display_date_value2, '%Y-%m-%d') >= '2020-09-22') ))
ORDER BY draggableviews_structure_weight_coalesce ASC

Masthead Slideshow

SELECT node.nid AS nid, 'node' AS field_data_field_link_node_entity_type, 'node' AS field_data_field_image_node_entity_type, COALESCE(draggableviews_structure.weight, 2147483647) AS draggableviews_structure_weight_coalesce
FROM {node} node
LEFT JOIN {field_data_field_display_date} field_data_field_display_date ON node.nid = field_data_field_display_date.entity_id AND (field_data_field_display_date.entity_type = 'node' AND field_data_field_display_date.deleted = '0')
LEFT JOIN {draggableviews_structure} draggableviews_structure ON node.nid = draggableviews_structure.entity_id AND draggableviews_structure.view_name = 'masthead_sorting_interface' AND draggableviews_structure.view_display = 'page_1' AND draggableviews_structure.args = '[]'
WHERE (( (node.type IN  ('masthead_image')) AND (node.status = '1') AND (DATE_FORMAT(field_data_field_display_date.field_display_date_value, '%Y-%m-%d') <= '2020-09-22') AND (DATE_FORMAT(field_data_field_display_date.field_display_date_value2, '%Y-%m-%d') >= '2020-09-22') ))
ORDER BY draggableviews_structure_weight_coalesce ASC
πŸ› Bug report
Status

Active

Version

2.1

Component

Code

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024