There's a lot of code in webform_entity_install() that looks like it was provide values for the newly created 'bundle' column but because of a funky test of an empty array it never executes. I didn't actually try it because it looked like a really convoluted way of going about it.

Before you ask for a DBTNG version of the query compare it to the elegant SQL string:

  $query = db_select('webform_submissions', 'ws');
  $query->innerJoin('node', 'n', 'ws.nid = n.nid');
  $query->distinct()
    ->fields('ws', array('sid'))
    ->fields('n', array('type'))
    ->condition('ws.bundle', NULL, 'IS NULL');
  $query->innerJoin('node', 'n', 'ws.nid = n.nid');
  $query->execute();
CommentFileSizeAuthor
webform_entity.patch1.93 KBdrewish
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

tizzo’s picture

Status: Needs review » Fixed

Good call, this is much cleaner.

Committed, thanks!

Status: Fixed » Closed (fixed)

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