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.
API page: https://api.drupal.org/api/drupal/core%21modules%21system%21system.api.p...
Enter a descriptive title (above) relating to function hook_schema, then describe the problem you have found:
There are 3 different drupal_get_schema-type functions. Looking at hook_schema(), which is your average developers' entry point into the schema API, it's not currently possible to figure out how to retrieve a schema that's been defined.
Comments
Comment #1
jhodgdonOK. I have no idea what the correct answer is...
Comment #2
joachim CreditAttribution: joachim commentedMy suggestion would be that hook_schema()'s docs should have a short paragraph which explains the API that one should use to retrieve a schema.
Comment #3
jhodgdonI agree but I'm not sure what that API is.
Comment #4
joachim CreditAttribution: joachim commenteddrupal_get_schema() and drupal_get_schema_unprocessed().
It turns out on closer reading that drupal_get_schema_versions() is stupidly named, as it has NOTHING to do with hook_schema() or Schema API!
Comment #5
jhodgdonI do not think this is a big issue... At this point, if you go to the api.d.o page for hook_schema(), you can see that there are two functions that invoke it, and both of them appear to have good documentation. So I'm just going to move this to D7. I don't actually think most developers would need to use either of those functions, and we don't necessarily tell where each hook is invoked in the docs, so... I think what we have in D8 is sufficient. Not sure about D7.