As part of my_module_install() I want to create and populate a vocabulary programmatically. To not duplicate any code I want to use the taxonomy_save_vocabulary(&$edit) function:
the problem is with displaying a nodes from a custom module in different orders (by title, total votes, chronological...).
I tried to do it inside hook_load with for example
db_fetch_object(db_query('SELECT nid, title, value FROM node
LEFT JOIN votingapi_cache ON (content_id=nid)
WHERE vid = %d AND function="count" ORDER BY title ', $node->vid) );
but the nodes would not be sorted by title at all. Tried db_rewrite_sql and it did not help too. Would someone point me to the right direction please? is hook_load where the sort should happen?
I came across a peculiar problem when creating forms using the forms api
my form has the following select element
(
[#required] =>
[#attributes] => Array
(
[class] => form-select
)
[#description] =>
[#input] => 1
[#name] => region
[#value] => 0
[#id] => edit-region
[#processed] =>
[#weight] => 0.001
[#options] => Array
(
[0] => None
[N] => Select Multiple
[P] => Select All
[1] => North America
[10] => South America
[2] => Asia
[3] => Africa
[4] => Europe
[5] => Latin America
[6] => Pacific
[7] => Polar
[8] => Caribbean
[9] => Central America & Mexico
)
[#default_value] => 0
[#title] => Destination Region
[#post] => Array
(
)
[#programmed] =>
[#parents] => Array
(
[0] => region
)
[#tree] =>
[#type] => select
)
as seen from above the default_value is supposed to the option[0] but when i render the form i get the options 0, M and N as selected options.
This is a serious bug. i'm using drupal-5.0-rc1. Has anyone seen this issue before ?
I want to do some callbacks in a module and I would just use a method like autocomplete, but I am wondering:
Does an autocomplete, like any on the ones on drupal.org, require a full bootstrap?
If so, isn't that a little excessive?
If not, then can anyone fill me in on best practice in this respect?