Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
The list of content types that may be added to a queue on the nodequeue's options page is in a weird order.
Thinking about the structure of my site, it's possibly by supplying module name. However, this isn't useful to ad admin at this point -- should be sorted by content type human name, since this is what's visible.
Comments
Comment #1
ezra-g CreditAttribution: ezra-g commentedCan you list the current order, as well as the machine-readable and human-readable names of your content types? This was supposed to have been fixed in a previous issue.
Comment #2
joachim CreditAttribution: joachim commentedThe list appears like this:
I'm not sure how to extract the machine names from the HTML for that page...
I'm not sure module name is influencing it after all. All the 'Embedded something' types are CCK, not module-provided, as is Vacancy, Press clipping, Press release, SAM Staff and many others.
Comment #3
ezra-g CreditAttribution: ezra-g commentedThe machine readable names appear under the "type" column at admin/content/types.
Comment #4
ezra-g CreditAttribution: ezra-g commentedComment #5
joachim CreditAttribution: joachim commentedHere's the list of human and machine names from the admin content page:
I'm particularly intrigued as to why event / event_date / event_series appear separated on nodequeue.
event and event_date are provided by a module called civi_event. event_series is a user-defined content type, ie just created with the admin interface.
Comment #6
joachim CreditAttribution: joachim commentedGot a bit suspicious when I saw Views' node type filter had the same wacky order.
The bug is in core: node.module's _node_types_build build up $_node_types by looking at each module in turn.
I've going to close this and refile as this issue will be a bit messy to follow.
Comment #7
joachim CreditAttribution: joachim commentedFiled http://drupal.org/node/347272, though looking at node_add() it may be that the design decision in node.module is that callers of node_get_types should sort what they are given.
Comment #8
joachim CreditAttribution: joachim commentedI've just noticed that CCK nodereference gets it right.
You CAN return a sorted array of node types that looks right to humans with node_get_types.
Currently, nodequeue is doing this:
Do this instead:
$nodes = node_get_types('names');
That gets you the types in the right order, and it's cleaner code too! :)
Part of the problem is that the documentation for this is unclear! See http://drupal.org/node/338402
Comment #9
drewish CreditAttribution: drewish commentedthe D6 version is calling
$nodes = node_get_types('names');
Comment #10
ezra-g CreditAttribution: ezra-g commentedThere's not actually a patch here.
Comment #11
amateescu CreditAttribution: amateescu commentedClosing because 5.x is not maintained anymore and this issue is not present in 6.x or 7.x.