The docs for hook_libraries_info() state that both 'version' and 'version callback' are optional.

This is technically true, but if neither is defined, the library will never be detected as installed, as this code in libraries_detect() shows:

  if (!isset($library['version'])) {
    // We support both a single parameter, which is an associative array, and an
    // indexed array of multiple parameters.
    if (isset($library['version arguments'][0])) {
      // Add the library as the first argument.
      $library['version'] = call_user_func_array($library['version callback'], array_merge(array($library), $library['version arguments']));
    }
    else {
      $library['version'] = $library['version callback']($library, $library['version arguments']);
    }
    if (empty($library['version'])) {
      $library['error'] = 'not detected';
      $library['error message'] = t('The version of the %library library could not be detected.', array(
        '%library' => $library['name'],
      ));
      return $library;
    }

Comments

Status:Active» Needs review
StatusFileSize
new2.49 KB
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch libraries-version-docs-improvement.patch. Unable to apply patch. See the log in the details link for more information.
[ View ]

Hmmm, it's even a bit more complicated than that, because 'version callback' defaults to 'libraries_get_version'. Does the attached patch clarify the situation?

StatusFileSize
new2.96 KB
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch libraries-version-docs-improvement-2.patch. Unable to apply patch. See the log in the details link for more information.
[ View ]

Wait, I messed that up. How's this one?

Status:Needs review» Needs work

The last submitted patch, libraries-version-docs-improvement-2.patch, failed testing.

Status:Needs work» Needs review
StatusFileSize
new2.98 KB
PASSED: [[SimpleTest]]: [MySQL] 135 pass(es).
[ View ]

Let's try this again.

Status:Needs review» Fixed

Status:Fixed» Closed (fixed)
Issue tags:+

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

Issue summary:View changes
Status:Closed (fixed)» Active

The patch does not seem to have changed the docs about the 'version' property.

A developer reading down the list of properties to see which are required would still think both of these are optional.

Status:Active» Fixed
StatusFileSize
new859 bytes

Status:Fixed» Closed (fixed)

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