Support version arguments differing by variant

Created on 11 February 2014, almost 11 years ago
Updated 31 July 2023, over 1 year ago

Problem

* It appears that version arguments declared within variants are not taken into account when performing version detection within libraries_detect().
* The documentation indicates that top-level properties (such as 'version arguments' would be overridden.

Details

An example of the the hook_libraries_info definition is:

  $libraries['backbone'] = array(
    'name' => 'Backbone',
    'vendor url' => 'http://documentcloud.github.io/backbone/',
    'download url' => 'http://backbonejs.org/backbone.js',
    'files' => array(
      'js' => array(
        'backbone.js',
      ),
    ),
    'version arguments' => array(
      'file' => 'backbone.js',
      'pattern' => '/Backbone.js\s*([\d\.]+)/',
    ),
    'versions' => array(
      '1.0.0' => array(
        'variants' => array(
          'source' => array(
            'files' => array(
              'js' => array(
                'backbone.js',
              ),
            ),
          ),
          'minified' => array(
            'files' => array(
              'js' => array(
                'backbone-min.js',
              ),
            ),
            'version arguments' => array(
              'file' => 'backbone-min.js',
              'pattern' => '/VERSION="([\d\.]+)"/',
            ),
          ),
        ),
      ),
    ),
    'dependencies' => array('underscore (>=1.4.4)'),
  );
🐛 Bug report
Status

Needs review

Version

2.0

Component

Code

Created by

🇺🇸United States eshta

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024