Download & Extend

Node Type Category Filters not working

Project:Image Upload
Version:6.x-1.2
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:active

Issue Summary

When I assign a category term to a particular node type, I expect that only the selected categories will appear when editing a node of that type. This is not the case, all categories still appear for node types where specific categories were selected.

Assuming this is the expected behavior, I believe the following code will fix the problem... although I haven't thoroughly tested it yet.

In... _image_upload_form_get_terms

foreach($terms as $tid => $term_name) {
if(! variable_get('image_upload_category_'. $tid .'_'. $node_type, 0)) {
unset($terms[$tid]);
}
}

nobody click here