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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

orbmantell’s picture

Assigned: orbmantell » Unassigned
Status: Active » Needs review
FileSize
1.19 KB
TravisCarden’s picture

Category: Bug report » Task
Status: Needs review » Needs work
  1. +++ b/includes/bootstrap.inc
    @@ -2954,10 +2954,15 @@ function ip_address() {
      * The returned schema will include any modifications made by any
      * module that implements hook_schema_alter().
      *
    + * To retrieve the raw schema as defined by the module use
    + * drupal_get_schema_unprocessed() instead.
    + *
    

    These 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()."

  2. +++ b/includes/bootstrap.inc
    @@ -2954,10 +2954,15 @@ function ip_address() {
    + *
    + * @see 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.

  3. +++ b/includes/common.inc
    @@ -7099,6 +7099,8 @@ function drupal_uninstall_schema($module) {
    + *
    + * @see drupal_get_schema()
    

    This could use an explanation parallel to the one proposed for drupal_get_schema_unprocessed() above in drupal_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."

orbmantell’s picture

Status: Needs work » Needs review
FileSize
1.29 KB

New patch attached to address the issues in #2

TravisCarden’s picture

Status: Needs review » Reviewed & tested by the community

Looks good!

jhodgdon’s picture

+1, thanks! Quick note: these functions do not exist, apparently, in Drupal8.

David_Rothstein’s picture

Status: Reviewed & tested by the community » Fixed

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

  • David_Rothstein committed 9c5cd0c on 7.x
    Issue #2530872 by orbmantell, TravisCarden: Improve documentation of...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.