Problem

When a quiz is deleted it simply does a query to delete the record from the quiz_node_proerties (see below)

quiz.module

function quiz_delete($node) {
// . . . [code hidden] . . .

  // Remove quiz node records from table quiz_node_properties
  db_delete('quiz_node_properties') // <- This should be replaced with a entity_delete_multiple() function call. 
    ->condition('nid', $node->nid)
    ->execute();
  // Remove quiz node records from table quiz_node_relationship
  db_delete('quiz_node_relationship')
    ->condition('parent_nid', $node->nid)
    ->execute();
  // Remove quiz node records from table quiz_node_result_options
  db_delete('quiz_node_result_options')
    ->condition('nid', $node->nid)
    ->execute();
}

As a result, any entity_delete hooks that are implemented don't get called for quiz entities.

Proposed resolution

I've attached a patch which replaces the db query with an entity_delete_multiple function call.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

partdigital’s picture

Status: Active » Needs review
FileSize
1.08 KB
djdevin’s picture

Status: Needs review » Fixed

Thanks!

  • djdevin committed 145847c on 7.x-5.x authored by partdigital
    Issue #2542264 by partdigital: Quiz delete does not invoke entity_delete...

Status: Fixed » Closed (fixed)

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