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

jhodgdon’s picture

OK. I have no idea what the correct answer is...

joachim’s picture

My 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.

jhodgdon’s picture

I agree but I'm not sure what that API is.

joachim’s picture

drupal_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!

jhodgdon’s picture

Version: 8.0.x-dev » 7.x-dev
Issue summary: View changes
Issue tags: -Needs backport to D7

I 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.