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

Created on 22 January 2023, over 1 year ago
Updated 27 September 2023, 9 months 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

Needs work

Version

10.1

Component
Comment 

Last updated 3 days ago

Created by

🇳🇱Netherlands eelkeblok Netherlands 🇳🇱

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.69.0 2024