After adding some annotations, if you then change the queue's sort order via the queue's View page (admin/content/nodequeue/%nodequeue/view/%subqueue), all the annotations associated with that queue's nodes get erased.
Nodequeue Annotate adds its annotations to nodequeue's nodequeue_nodes table and the nodequeue_save_subqueue_order() function clears out a subqueue's rows in that table when updating its sort order:
// clear the queue and save the new positions
db_query('DELETE FROM {nodequeue_nodes} WHERE sqid = %d', $sqid);
foreach ($nodes as $pos => $node) {
$args = array();
if ($pos != 'r') {
$positions[] = $pos;
$placeholders = ' (%d, %d, %d, %d, %d)';
$args = array($sqid, $qid, $node['nid'], $pos, $now);
}
if (!empty($args)) {
$sql = 'INSERT INTO {nodequeue_nodes} (sqid, qid, nid, position, timestamp) VALUES '. $placeholders;
db_query($sql, $args);
}
}
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | nodequeue_annotate-sorting_deletes_annotations-1379312-2.patch | 6 KB | matt v. |
Comments
Comment #1
daniboy commentedI'm afraid I do not have time to write a patch to fix this issue. If you can write a patch I will commit it :)
Comment #2
matt v. commentedFor my use case, I also needed to be able to specify the annotations from the queue's View page. Initially I worked on a submodule to add the functionality. Since the code coincidentally addresses this issue too, I went ahead and rolled it into this patch for Nodequeue Annotate.