Closed (fixed)
Project:
Node Hierarchy
Version:
5.x-1.1
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
16 Jul 2008 at 10:21 UTC
Updated:
1 Aug 2008 at 03:14 UTC
The pulldown list of parents shown in node edit page should use db_rewrite_sql in the selection of possible parent nodes, so other modules may filter the results.
For instance, the i18n module could filter out parents from other languages, so in the list only nodes in the same language would be shown.
This happens in the function _nodehierarchy_get_parent_pulldown_items
function _nodehierarchy_get_parent_pulldown_items( $parent_id, $types, $child_node = null, $depth = 0 ) {
$out = array();
//Note the order of the tables. Switched "{node} n" to the last place so the rewrite would work ok.
$query = "SELECT * FROM {nodehierarchy} h, {node} n WHERE h.nid = n.nid AND h.parent = %d AND n.type IN (". implode( ",", $types ) .") ORDER BY n.title ASC";
// Added db_rewrite_sql so other modules may filter the query further
$result = db_query(db_rewrite_sql($query),$parent_id);
// ... rest of the function ...
Comments
Comment #1
ronan commentedThanks for the heads-up, I'll get that taken care of as soon as I can
Ronan
Comment #2
ronan commentedI've made that change in 5.x dev, thanks again
Comment #3
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.