PDOException: SQLSTATE[21000]: Cardinality violation: 1241 Operand should contain 1 column(s): SELECT f.nid AS nid, f.tid AS tid FROM {forum} f WHERE (f.vid = :db_condition_placeholder_0_0, :db_condition_placeholder_0_1) in forum_node_load()

Also a bad call to db_create_table() in forum_update_7001()

Set to needs work because there should be a test for forum_node_load()

CommentFileSizeAuthor
#2 forum.patch2.54 KBmfb
forum.patch1.52 KBmfb
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

catch’s picture

It's my understanding that ->condition should default to IN when given an array.

-      ->condition('f.vid', $node_vids);

Clearly that's not working. Personally I'd rather specific IN for that case anyway, but might be worth looking into.

mfb’s picture

Status: Needs work » Needs review
FileSize
2.54 KB

OK, let's see if this passes tests. I tweaked the SelectQuery::condition() method.

catch’s picture

Status: Needs review » Reviewed & tested by the community

Looks great.

Status: Reviewed & tested by the community » Needs work

The last submitted patch failed testing.

catch’s picture

Status: Needs work » Reviewed & tested by the community
Dries’s picture

Are these tests useful as is? Sure, there could be exceptions, but it feels like they could also be made more robust?

catch’s picture

There aren't many situations in forum.module itself where you'll get two fully loaded nodes on one page, possibly none (at least not at the moment, it's all spaghetti queries in there). However Drupal.org at least promotes forum topics to the front page, so it's a valid test I think.

catch’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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