Problem/Motivation

Follow-up to #1498662-11: Refactor comment entity properties to multilingual
currently CommentStorage::buildQuery() adds inner join that have @todo to remove

Proposed resolution

fix todo

Remaining tasks

tbd

User interface changes

no

API changes

no

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

andypost’s picture

Status: Active » Needs review
FileSize
1.08 KB

stub

Status: Needs review » Needs work

The last submitted patch, 1: 2292815-1.patch, failed testing.

joshi.rohit100’s picture

Status: Needs work » Needs review
FileSize
614 bytes

Updated.

andypost’s picture

Status: Needs review » Needs work

@joshi.rohit100 As the issue said the patch should remove this join - no reason to join users because comment does not use the fetched data.
See comment_prepare_author()

larowlan’s picture

Status: Needs work » Needs review
FileSize
554 bytes
1.62 KB

Like so? Not sure of the perf implications here though.
i.m.o the join is better.

andypost’s picture

Status: Needs review » Reviewed & tested by the community

Actually it depends on usage, and a kind of commenters ;)

Anyway there's no performance effect because:
1) comment_prepare_author() in template_preprocess_comment() anyway loads/creates a user object to properly theme a username
2) parent comment is loaded for each rendered comment #1857946: Comment parent template variables are built twice

Berdir’s picture

Yeah, a mongodb backend for example couldn't add such a join, and one entity storage shouldn't assume anything about another, they might not even be in the same place.

catch’s picture

Are we already multiple loading all referenced users for comment listings?

  • catch committed 4ab1724 on 8.x
    Issue #2292815 by larowlan, joshi.rohit100, andypost: Remove join...
andypost’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.