When creating a view with the "Updated/commented date" sort, I receive the following error:

SQLSTATE[42S22]: Column not found: 1054 Unknown column 'node.changed' in 'field list':

The "changed" field is no longer contained in the node table; it's in the node_field_data table. I attempted to change line 18 of core/modules/comment/src/Plugin/views/sort/StatisticsLastUpdated.php to reflect that, which resolves the error and sorts correctly but seemed to cause duplication in my case.

CommentFileSizeAuthor
#5 views.view_.activity.yml6.83 KBstephenward

Comments

StephenWard created an issue. See original summary.

stephenward’s picture

Title: Updated/commented date throws » Updated/commented date sort throws SQL error
cilefen’s picture

Title: Updated/commented date sort throws SQL error » Unknown column 'node.changed' in 'field list' when sorting by updated/commented date
Component: comment.module » views.module
cilefen’s picture

Component: views.module » comment.module
Priority: Normal » Major

Actually, you were probably right about the comment component if that's where you think the bug is. Usually we like to have the view definition exported and attached to a comment if you don't mind.

stephenward’s picture

StatusFileSize
new6.83 KB

Apologies. Here you go. Please let me know if I can be of any more help.

jonathanshaw’s picture

I've hit the same bug, but not been able to trace the root of it. I think I found that it did not happen on a clean blank install, but once I imported my site configuration it happened even when creating a new view with any content type. I do have more than one comment type configured, that may be a direction to explore.

stephenward’s picture

Since @jonathanshaw mentioned it, I can confirm that my site was recently upgraded from Drupal 7 using the Migrate suite of modules. This may or may not be probative, however, since the changed field still doesn't exist in the node table anymore. One way or another, it seems like this must be in error.

jonathanshaw’s picture

I'm not migrating from D7; I was referring to importing my previously-exported D8 site configuration.

andypost’s picture