Wowjs can't detect correctly latest wow 1.1.2 version. In Reports > Status Report page wow version is empty.

Comments

GoddamnNoise’s picture

Hi bubu,

I've just tried to install the wowjs module with the 1.1.2 version of the WOW JS library on a fresh Drupal install with no problems at all. The version is detected and correctly reported in the "Reports > Status Report" page. The wowjs module relies on the libraries module to detect the version, so probably you need to update the libraries module to get the version during the installation of the wowjs module.

GoddamnNoise’s picture

Status: Active » Closed (cannot reproduce)
jimmynash’s picture

Version: 7.x-1.0 » 7.x-1.1
Status: Closed (cannot reproduce) » Active

I'm re-opening this because I think it is applicable to a recent change.

I just spun up a fresh install and added the 7.x-1.1 version along with a WOW library downloaded via the drush command.

The status report shows "Installed ()" without the version number. After digging into the module I checked the current WOW repo and found this commit:

https://github.com/matthieua/WOW/commit/2352f029c0841fdd4a42f20112e538be...

So I added the version line back into the bower.json file as per that commit, cleared caches and things seem to work now.

When libraries_load was being called it was returning an error message like "Unable to detect version" and "loaded" FALSE.

I would provide a patch but I'm not sure what is to be done if the version has been removed from the bower file.

GoddamnNoise’s picture

Hi jimmynash,

Thanks a lot for reporting this problem again and looking for the cause. I've seen the commit you linked to. I don't know why they have decided to remove the version. I don't know either what to do if the version has been removed from the bower file. I'll set the status to "Postponed" until i'll figure it out what to do in that case. Any ideas will help. Thanks again!.

GoddamnNoise’s picture

Status: Active » Postponed (maintainer needs more info)
jimmynash’s picture

Status: Postponed (maintainer needs more info) » Needs review

It looks like the version number is still in the package.json file.

I tried changing line 79 of wowjs.module to be package.json instead of bower.json, so

/**
 * Implements hook_libraries_info().
 */
function wowjs_libraries_info() {
  $libraries['wow'] = array(
    'name' => 'wow',
    'vendor url' => WOWJS_VENDOR_URL,
    'download url' => WOWJS_DOWNLOAD_URL,
    'version arguments' => array(
      'file' => 'bower.json',
      'pattern' => '/((?:\d+\.?){2,3})/',
    ),
    'files' => array(
      'js' => array(
        'dist/wow.min.js',
      ),
    ),
    'variants' => array(
      'minified' => array(
        'files' => array(
          'js' => array(
            'dist/wow.min.js',
          ),
        ),
      ),
      'source' => array(
        'files' => array(
          'js' => array(
            'dist/wow.js',
          ),
        ),
      ),
    ),
  );

  return $libraries;
}

becomes

/**
 * Implements hook_libraries_info().
 */
function wowjs_libraries_info() {
  $libraries['wow'] = array(
    'name' => 'wow',
    'vendor url' => WOWJS_VENDOR_URL,
    'download url' => WOWJS_DOWNLOAD_URL,
    'version arguments' => array(
      'file' => 'package.json',
      'pattern' => '/((?:\d+\.?){2,3})/',
    ),
    'files' => array(
      'js' => array(
        'dist/wow.min.js',
      ),
    ),
    'variants' => array(
      'minified' => array(
        'files' => array(
          'js' => array(
            'dist/wow.min.js',
          ),
        ),
      ),
      'source' => array(
        'files' => array(
          'js' => array(
            'dist/wow.js',
          ),
        ),
      ),
    ),
  );

  return $libraries;
}

I cleared caches and everything seems to work just fine. I didn't have to change the pattern or anything else. Just pointed the library definition at a different file.

Based on the history of the WOW repo for the package.json file it looks like that should be there all the time.

GoddamnNoise’s picture

Hi again, jimmynash,

I've figured it out the same thing as you did!!! :-). I've already make those changes in the module and tested it. I was commiting the changes when i've received your comment. I'll make a new release with the change applied and i'll give you credit on that commit. Thanks again for your help.

  • GoddamnNoise committed fd29f30 on 7.x-2.x
    Issue #2492095 by jimmynash: Fixed version retrieval.
    
    Version has been...
GoddamnNoise’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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