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.
Currently when a library's version cannot be determined, the following error message is provided:
'The version of the %library library could not be detected.'
There are two reasons a version could not be determined:
- The file specified to contain the version information is not present.
- The pattern to find the file information did not produce a match.
Knowing which case caused the failure can help end users debug their library dependency issues.
Comment | File | Size | Author |
---|
Comments
Comment #1
jessebeach CreditAttribution: jessebeach commentedThis patch provides error messages for the two cases stated in the issue summary.
Comment #2
jessebeach CreditAttribution: jessebeach commentedComment #5
jessebeach CreditAttribution: jessebeach commentedFixed the failing tests.
Comment #6
gobinathmFix works
Comment #7
tstoecklerDue to libraries_get_version() taking $library by reference with this patch, this is an API change. Other version callbacks might call libraries_get_version() in a way that is incompatible with references. Therefore (sadly...) moving this to 7.x-3.x
Here's an updated patch. I brought back the fallback error message in order to be sort of backwards-compatible but at that point I hadn't realized the above yet. Therefore we might not actually want that. However, we should allow the same behavior for variant callbacks, so this needs work on that either way. Also re-titling for that.
The inderdiff is with -w so don't try to apply it.
Comment #8
Wim LeersComment #9
Chris Matthews CreditAttribution: Chris Matthews as a volunteer commentedThe 5 year old patch in #7 does not apply to the latest libraries 7.x-2.x-dev and if still applicable needs a reroll.