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

node_field_data.created should be set in the field, but because it uses node.created, it will become column not found in Views.

When using fields, use node_field_data.changed correctly.

CommentFileSizeAuthor
#2 3065300-fix-table-name-1-8.7.x.patch1.58 KBotofu

Comments

otofu created an issue. See original summary.

otofu’s picture

Status: Active » Needs review
StatusFileSize
new1.58 KB
u7aro’s picture

Status: Needs review » Reviewed & tested by the community

It's working for me.

catch’s picture

Priority: Normal » Critical
Status: Reviewed & tested by the community » Needs work
Issue tags: +Needs tests

This is a critical bug that can be run into by end users with normal configuration, but we also need test coverage here.

Version: 8.7.x-dev » 8.8.x-dev

Drupal 8.7.9 was released on November 6 and is the final full bugfix release for the Drupal 8.7.x series. Drupal 8.7.x will not receive any further development aside from security fixes. Sites should prepare to update to 8.8.0 on December 4, 2019. (Drupal 8.8.0-beta1 is available for testing.)

Bug reports should be targeted against the 8.8.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.9.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.7 was released on June 3, 2020 and is the final full bugfix release for the Drupal 8.8.x series. Drupal 8.8.x will not receive any further development aside from security fixes. Sites should prepare to update to Drupal 8.9.0 or Drupal 9.0.0 for ongoing support.

Bug reports should be targeted against the 8.9.x-dev branch from now on, and new development or disruptive changes should be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

catch’s picture

Issue tags: +Bug Smash Initiative
lendude’s picture

The fix in #2 probably works when the comments are on a node field, but still fatals when the comment field is on a different entity.

Adding the sorting to a View of taxonomy terms after applying the fix in #2 gives
SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' comment_entity_statistics.last_comment_timestamp) AS comment_entity_statistics_' at line 1: SELECT taxonomy_term_field_data.langcode AS taxonomy_term_field_data_langcode, taxonomy_term_field_data.tid AS tid, GREATEST(.changed, comment_entity_statistics.last_comment_timestamp) AS comment_entity_statistics_last_updated FROM {taxonomy_term_field_data} taxonomy_term_field_data INNER JOIN {comment_entity_statistics} comment_entity_statistics ON taxonomy_term_field_data.tid = comment_entity_statistics.entity_id AND comment_entity_statistics.entity_type = :views_join_condition_0 WHERE taxonomy_term_field_data.status = :db_condition_placeholder_1 ORDER BY comment_entity_statistics_last_updated ASC LIMIT 11 OFFSET 0; Array ( [:db_condition_placeholder_1] => 1 [:views_join_condition_0] => taxonomy_term )

So we probably need a fix that finds the correct data table for the entity that the comments are on.

mohit_aghera’s picture

This seems duplicate of another issue https://www.drupal.org/project/drupal/issues/2086125#comment-13753699
There has been significant progress there.

@Lendude Can we close this?

Version: 8.9.x-dev » 9.2.x-dev

Drupal 8 is end-of-life as of November 17, 2021. There will not be further changes made to Drupal 8. Bugfixes are now made to the 9.3.x and higher branches only. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.2.x-dev » 9.3.x-dev
larowlan’s picture