JavaScript broken when using cropper.js v1.5.12

Created on 24 August 2022, almost 3 years ago
Updated 7 April 2025, 3 months ago

Problem/Motivation

JavaScript which initiates the cropper integration has issues when using the latest cropper.js v1.5.12. This is due to the newer versions of cropper.js not including the jQuery wrapper by default. The jQuery wrapper is now a separate repository, https://github.com/fengyuanchen/jquery-cropper.

ImageWidgetCropType.js?v=2.1:499 Uncaught TypeError: this.$image.on(...).on(...).on(...).cropper is not a function
    at Drupal.ImageWidgetCropType.initializeCropper (ImageWidgetCropType.js?v=2.1:499:8)

Steps to reproduce

  1. Install the module
  2. Install the latest cropper.js v1.5.12 library
  3. Set at least one image field to use the Image Widget Crop widget
  4. Attempt to upload and crop an image in that field

Proposed resolution

Update instances of this.$image.cropper(...) to use standard integration method.

πŸ› Bug report
Status

Needs review

Version

2.0

Component

User interface

Created by

πŸ‡ΊπŸ‡ΈUnited States robphillips

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