Missing FitVids.js library causes error in file_get_contents

Created on 22 January 2025, 3 months ago

**Problem/Motivation:**
When the FitVids module is installed, it references a JavaScript file (`jquery.fitvids.js`) that is not included in the module package. This causes errors such as:

Problem/Motivation

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Needs work

Version

2.1

Component

Code

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

Merge Requests

Comments & Activities

  • Issue created by @Haris Khan Jadoon
  • Merge request !7fix: Missing FitVids.js issue → (Open) created by Haris Khan Jadoon
  • 🇮🇳India ravi.joshi53

    Issue
    The problem persist with all of the newer versions such as fitvids 2.1.0, fitvids 2.0.0, fitvids 2.0.x-dev, fitvids 8.x-1.1. It can easily be reproduced just by installation say composer require 'drupal/fitvids:^2.1' or other.

    Workaround
    As a workaround, I made it work by changing $path inside fitvids.install file from $path = DRUPAL_ROOT . '/libraries/fitvids/jquery.fitvids.js'; to $path = DRUPAL_ROOT . '/modules/contrib/fitvids/js/jquery.fitvids.js';. Also enable js/jquery.fitvids.js: {} and disable /libraries/fitvids/jquery.fitvids.js: {} inside fitvids.libraries.yml file. The error is gone but haven't tested it yet. I need to create a page containing video to test it.

    PS
    I believe that there should be a better way to set $path, i.e., $path = DRUPAL_ROOT . '/modules/contrib/fitvids/js/jquery.fitvids.js'; such as $path = libraries_get_path('fitvids') . '/js/jquery.fitvids.js';. This needs to be tested first.

Production build 0.71.5 2024