diff -u api.orig/api.module api/api.module
--- api.orig/api.module 2009-07-09 00:35:05.000000000 +0200
+++ api/api.module 2009-07-09 01:32:28.000000000 +0200
@@ -949,7 +949,14 @@
return api_link_documentation($branch->documentation, $branch_name);
}
else {
- return t('A main page for this branch has not been indexed. A documentation comment with @mainpage {title} needs to exist, or has not been indexed yet. For Drupal core, this is availiable in the developer documentation in the contributions repository.');
+ // If no mainpage is defined, use a group's page instead
+ $result = db_query("SELECT documentation FROM {api_documentation} WHERE object_name = '%s' AND branch_name = '%s' AND object_type = 'group'", $branch_name, $branch_name);
+ if ($branch = db_fetch_object($result)) {
+ return api_link_documentation($branch->documentation, $branch_name);
+ }
+ else {
+ return t('A main page for this branch has not been indexed. A documentation comment with @mainpage {title} needs to exist, or has not been indexed yet. For Drupal core, this is availiable in the developer documentation in the contributions repository.');
+ }
}
}