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 pages:
https://api.drupal.org/api/drupal/includes%21bootstrap.inc/function/drup...
https://api.drupal.org/api/drupal/includes%21common.inc/function/drupal_...
The docblocks for drupal_get_schema() and drupal_get_schema_unprocessed() need improvement. They have at least the following issue:
- They don't @see closely-related functions.
Patch to follow.
Comment | File | Size | Author |
---|---|---|---|
#3 | drupal-improve-documentation-2530872-3.patch | 1.29 KB | orbmantell |
Comments
Comment #1
orbmantell CreditAttribution: orbmantell as a volunteer commentedComment #2
TravisCarden CreditAttribution: TravisCarden as a volunteer commentedThese two sentences are so closely related they should follow one another immediately (No paragraph break.)
In the added sentence, "the module" is ambiguous. (What module?) And as I'm unable to find any other reference in the codebase to a schema as "raw", I would propose alternative language. Perhaps something like, "To get the schema without modifications, use drupal_get_schema_unprocessed()."
Since you're already mentioning the function above with explanation, it's probably not necessary to also add an
@see
reference.This could use an explanation parallel to the one proposed for
drupal_get_schema_unprocessed()
above indrupal_get_schema()
. I would remove the@see
reference and add a sentence at the end of the second paragraph: "...and these unprocessed definitions won't be cached."Comment #3
orbmantell CreditAttribution: orbmantell as a volunteer commentedNew patch attached to address the issues in #2
Comment #4
TravisCarden CreditAttribution: TravisCarden as a volunteer commentedLooks good!
Comment #5
jhodgdon+1, thanks! Quick note: these functions do not exist, apparently, in Drupal8.
Comment #6
David_Rothstein CreditAttribution: David_Rothstein as a volunteer commentedCommitted to 7.x - thanks!
In Drupal 8 this has been renamed to drupal_get_module_schema() and slightly changed (see https://www.drupal.org/node/2467521) but since there's only one function there rather than two, this change would not be relevant for Drupal 8.