Skip to content

fix(settings): load renamed Jcrop 2.0 assets for avatar cropper#41724

Merged
phil-davis merged 2 commits into
masterfrom
fix/avatar-cropper-jcrop-path
Jul 24, 2026
Merged

fix(settings): load renamed Jcrop 2.0 assets for avatar cropper#41724
phil-davis merged 2 commits into
masterfrom
fix/avatar-cropper-jcrop-path

Conversation

@DeepDiver1975

Copy link
Copy Markdown
Member

Summary

Fixes the avatar cropper, which broke with $cropperImage.Jcrop is not a function when uploading a non-square profile picture.

Root cause

PR #38666 bumped @bower_components/jcrop from 0.9.12 → 2.0.4. Jcrop 2.0 renamed its distribution files:

  • js/jquery.Jcrop.jsjs/Jcrop.js
  • css/jquery.Jcrop.csscss/Jcrop.css

But settings/templates/panels/personal/profile.php still referenced the old paths via vendor_script/vendor_style. The script 404'd, $.fn.Jcrop was never registered on jQuery, and cropping threw $cropperImage.Jcrop is not a function (profile.js:93).

Fix

Point the template at the renamed Jcrop assets.

Compatibility

The Jcrop 2.0.4 JS API is backward-compatible with profile.js's usage — onChange, onSelect, setSelect, aspectRatio, boxWidth, boxHeight are all still supported through 2.0.4's legacyHandlers shim, which invokes the callback with the unscaled {x, y, w, h} coords that saveCoords/sendCropData expect. Jcrop.gif is referenced relative to the CSS and ships in the 2.0.4 package. So this is purely a filename-path break, not an API break.

🤖 Generated with Claude Code

Jcrop 2.0.4 renamed its distribution files from js/jquery.Jcrop.js and
css/jquery.Jcrop.css to js/Jcrop.js and css/Jcrop.css. The personal profile
template still referenced the old paths, so the script 404ed, $.fn.Jcrop was
never registered, and cropping a non-square avatar threw "$cropperImage.Jcrop
is not a function". Point the template at the renamed assets.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: Thomas Müller <1005065+DeepDiver1975@users.noreply.github.com>
@DeepDiver1975
DeepDiver1975 requested a review from a team as a code owner July 24, 2026 11:48
Comment thread changelog/unreleased/avatar-cropper-jcrop-path Outdated

@phil-davis phil-davis left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested manually, profile pictures can be uploaded and/or use an existing file, and are processed correctly.

@phil-davis

Copy link
Copy Markdown
Contributor

Fixes #41723

Signed-off-by: Phillip Davis <phil@jankaritech.com>
@phil-davis
phil-davis merged commit dff36bd into master Jul 24, 2026
29 checks passed
@phil-davis
phil-davis deleted the fix/avatar-cropper-jcrop-path branch July 24, 2026 13:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants