Closed (fixed)
Project:
Drupal core
Version:
6.x-dev
Component:
documentation
Priority:
Normal
Category:
Bug report
Assigned:
Issue tags:
Reporter:
Created:
24 Nov 2008 at 11:30 UTC
Updated:
2 Jan 2014 at 23:45 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
joachim commentedA number of modules are using this function incorrectly and showing a badly sorted list of node types to admin users, eg: Nodequeue (http://drupal.org/node/347272, and also Views.
So this really needs a fix.
From what I can tell:
'names' gets you an array of the form 'machine name' => 'human name' and it's sorted so the order looks right.
'types' (the default) gets you a list sorted the same as the query (so module weight?). A lot of modules are using this, then filtering the resulting array to get 'machine name' => 'human name' when they should be using 'names'.
Comment #3
casey commentednode_get_types() is renamed to:
node_type_get_types()
node_type_get_names()
node_type_get_type($node)
node_type_get_name($node)
node_type_get_base($node)
Those functions have pretty clear comments.
Comment #4
joachim commentedFixing the docs on 6 might still be a good idea; 6 will be supported for some time yet.
Comment #5
jhodgdonhttp://api.drupal.org/api/function/node_get_types/6 if anyone wants to look at the function doc.
Comment #6
jhodgdonHere's a patch to fix up this function doc.
Comment #7
jhodgdonGracious this is old.
The patch needs a reroll and a review. Reroll is good project for a novice contributor...
Comment #8
jhodgdonComment #9
drupal_was_my_past commentedWorking on this at BADCamp.
Comment #10
drupal_was_my_past commentedRe-rolled patch from #6.
Comment #11
jhodgdonThere is a typo in the first line: I think the 1st "of" should be "or":
" and returns all of part of this list. "
Other than that, the patch looks good,... of course it would probably look good to me, since I wrote the original a while back... gracious, I hope someone else reviews it sooner than a year this time!
Comment #12
drupal_was_my_past commentedOoo bummer. I even proof read this and totally missed that typo. Here is a re-roll.
Comment #13
jhodgdonLooks good to me now, thanks! Typos are one reason that we have people review patches -- happens to everyone. :)
Comment #14
gábor hojtsyThanks, committed, pushed.