Sorting and filtering on last updated/commented date in Views is broken

Created on 22 January 2023, almost 2 years ago

Problem/Motivation

The comment module offers a combination of field, sort and filter for Views on "The most recent of last comment posted or entity updated time." Sorting and filtering on this value, however, is completely broken, because they are trying to get the changed field from the node table, which has long ago moved to the node_field_data table.

Steps to reproduce

  • Set up a content type and comment type.
  • Create at least two nodes, one with comments, one without
  • Create a view of nodes of the content type
  • Add a field "The most recent of last comment posted or entity updated time"
  • (Add a sort on "The most recent of last comment posted or entity updated time" - you won't be able to do this because the previous step will already fail)

Proposed resolution

  • Adjust the handlers to use the correct table
  • Create one or more tests to verify the solution

Remaining tasks

  • Create tests
  • Create solution for the problem
  • Review
  • Commit

User interface changes

None.

API changes

None.

Data model changes

None.

Release notes snippet

Todo.

🐛 Bug report
Status

Active

Version

10.1

Component
Comment 

Last updated about 5 hours ago

Created by

🇳🇱Netherlands eelkeblok Netherlands 🇳🇱

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

Comments & Activities

Production build 0.71.5 2024