You are here

function nodequeue_remove_action in Nodequeue 7.2

Same name and namespace in other branches
  1. 5.2 nodequeue.actions.inc \nodequeue_remove_action()
  2. 6.2 nodequeue.module \nodequeue_remove_action()
  3. 7.3 includes/nodequeue.actions.inc \nodequeue_remove_action()
1 call to nodequeue_remove_action()
nodequeue_add_action in includes/nodequeue.actions.inc
Action to add a node to a queue.

File

includes/nodequeue.actions.inc, line 190
nodequeue.actions.inc Provides actions integration for nodequeues.

Code

function nodequeue_remove_action($node, $context) {
  $qids = $context['qids'];

  // If a node is being deleted, ensure it's also removed from any queues.
  $args = $qids;
  $result = db_select('nodequeue_nodes', 'n')
    ->fields('n')
    ->condition('nid', $node->nid)
    ->condition('qid', $args)
    ->execute()
    ->fetchAll();
  foreach ($result as $obj) {

    // This removes by nid, not position, because if we happen to have a
    // node in a queue twice, the 2nd position would be wrong.
    nodequeue_subqueue_remove_node($obj->sqid, $node->nid);
  }
}