Galleria not detecting library JS files

Created on 1 February 2023, almost 2 years ago

Problem/Motivation

The Scald Galleria module is not correctly detecting the path to the galleria.js or galleria.min.js files or theme *.js files.

Steps to reproduce

Visit the Download page and click the Download link, i.e. https://github.com/galleriajs/galleria/archive/1.6.1.zip
(I even tested this with other versions on GitHub and had the same problems with the paths.)

  1. Extract the Galleria library to sites/all/libraries/galleria
  2. Install the module and enable
  3. For the Gallery context, expand Original, and the player representation to Galleria
  4. Create a page, upload and embed a gallery
  5. Save and view the page
  6. From there, you can view the source (with JS aggregation disabled) to confirm that the JS library file is not attached
πŸ› Bug report
Status

Needs review

Version

2.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States hargobind Austin, Texas

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

Comments & Activities

  • Issue created by @hargobind
  • Status changed to Needs review almost 2 years ago
  • πŸ‡ΊπŸ‡ΈUnited States hargobind Austin, Texas

    Attached is a patch that changes how scald_galleria_get_library_file() searches the library directory to find *.js paths.

    Assuming the library path of sites/all/libraries/galleria, this new code searches the following directories in this order:
    sites/all/libraries/galleria
    sites/all/libraries/galleria/dist
    sites/all/libraries/galleria/src

    There is also a change to the filenames passed to glob(), i.e. galleria*.js instead of the old galleria-*.js. Older versions of the library had filenames like "galleria-1.4.2.js", but all versions that are currently available on github.com simply use "galleria.js" or "galleria.min.js".

Production build 0.71.5 2024