hi,
first off: wow! you guys are so fast! incredible.

a missing library doesn't get detected.

in libraries 2.x library_detect returns FALSE only if the library is unknown to drupal(that is no module mentions it). otherwise it returns an array, even if the library is not found or other errors occur. it returns same array hook_libraries_info() returns.
it in turn holds information about the library(errors , installed etc).
so
if (libraries_detect('xregexp'))
in this place is always true because it allways returns an array(due to the module the lib is known even if not installed or otherwise corrupt). instead there needs to be rather something like this:

$lib = libraries_detect('xregexp');
if($lib && $lib['installed']){
....
}

reference:
a) http://drupal.org/node/1342238
b) comments in libraries module. esp.:

* @return array|false
 *   An associative array containing registered information for the library
 *   specified by $name, or FALSE if the library $name is not registered.
 *   In addition to the keys returned by libraries_info(), the following keys
 *   are contained:
 *   - installed: A boolean indicating whether the library is installed. Note
 *     that not only the top-level library, but also each variant contains this
 *     key.
 *   - version: If the version could be detected, the full version string.
 *   - error: If an error occurred during library detection, one of the
 *     following error statuses: "not found", "not detected", "not supported".
 *   - error message: If an error occurred during library detection, a detailed
 *     error message.
 *
 * @see libraries_info()

[ i looked at different versions of libraries but looks like you use version 7.x.2.x for reference, please correct me if thats where i am wrong ]

Comments

attiks’s picture

Assigned: Unassigned » jelle_s
attiks’s picture

Assigned: jelle_s » Unassigned
Status: Active » Fixed

Fixed and only libraries 7.x.2.x

Status: Fixed » Closed (fixed)

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

Anonymous’s picture

Issue summary: View changes

inserted a missing $