When nodes have multiple taxonomy terms attached, are orderable in multiple categories, changing the order doesn't work.
This turns out to be because the term id is not taken into account when fetching the weights (in the nodeorder_node_load function), causing the weights of the nodes associated with others terms to overwrite the correct weight.
I rewrote the nodeorder_node_load function in nodeorder.module as following to fix this :
function nodeorder_node_load($nodes, $types) {
if (arg(0) == 'taxonomy' && arg(1) == 'term' && arg(2)) $tid = arg(2);
else $tid = '';
$query = db_select('taxonomy_index', 't')
->condition('nid', array_keys($nodes), 'IN');
if ($tid) $query->condition('tid', $tid);
$result = $query
->fields('t', array('weight', 'nid'))
->execute();
foreach ($result as $record) {
$nodes[$record->nid]->weight = $record->weight;
}
}
Comments
Comment #1
mfernea commentedI have the same issue and I also think that nodeorder_node_load should be modified. The patch is based on the code posted by syngi. I think that the function should do nothing if the node load doesn't happen in a page related to a term.
Comment #3
dieuwe