Reviewed & tested by the community
Project:
Manual Crop
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
10 Jun 2015 at 20:45 UTC
Updated:
20 Nov 2020 at 03:04 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
tessa bakkerComment #2
matthijsI don't know if there's any convention about this, but I always use the "jquery." prefix to indicate a jQuery based library + it matches the JavaScript file name.
If I would apply this patch, the imagesLoaded library should be updated accordingly (the "jquery." prefix is missing here as well), but there are other modules that use the current path as well.
Comment #3
tessa bakkerYou can always point other modules to https://www.drupal.org/node/1858390 for the correct folder name.
Comment #4
matthijsThat page lists "jquery.imgareaselect" :-)
Comment #5
tessa bakkerDocumentation update (https://www.drupal.org/node/1858390) with new Vendor URL, so this needs some work for imagesloaded.
Comment #6
tessa bakkerNew patch for both libraries with a few extra changes for new users:
- Vendor URL fix of imagesloaded
- Version check, this will fix a lot of support questions ;)
- Added default Libraries API feedback for version and location check
- Drush example make file fix for downloading the libraries to the correct location with some coding style fixes
Comment #7
espurnesPatch #6 works for me. Thank you Tessa Bakker.
I've used the libraries defined in README.txt and I've placed them in /sites/all/libraries/imagesloaded and /sites/all/libraries/imgareaselect.
- imagesLoaded:
+ Website: http://desandro.github.io/imagesloaded
+ Download: https://github.com/desandro/imagesloaded/archive/v2.1.2.tar.gz
- imgAreaSelect:
+ Website: http://odyniec.net/projects/imgareaselect
+ Download: https://github.com/odyniec/imgareaselect/archive/v0.9.11-rc.1.tar.gz
NOTE: I tried imgareaselect v1.0.0-rc.1 but it doesn't work, so use v0.9.11-rc.1
Comment #8
espurnesIn the same website I have Manual Crop with the #6 patch I just installed the module field_slideshow. This second module also needs imagesloaded plugin for best results.
But this plugin must be placed in /sites/all/libraries/jquery.imagesloaded.
So I need to:
Is there a coding standard that says that jquery plugins must be placed in /sites/all/libraries/jquery.name_of_the_plugin ?
If not, why two different modules needs to rename the downloaded directory to jquery.name_of_the_plugin ?
By now, I will unpatch the #6 and try to use imagesloaded in both modules.
Comment #9
tessa bakkerThere isn't any coding standard that I know of. But it is common to change less as possible.
More examples can be found at: https://www.drupal.org/node/1858390
Comment #10
tessa bakkerPatch #6 needs to be tested with Masonry for version conflicts.
Screenshot and more info about this case with ManualCrop 1.5 can be found at #2543668: ImagesLoaded not detected / version conflict.
Comment #11
aguilarm commented+1 for this patch, using the git repo names makes managing your libraries through composer much easier.
Comment #12
kopeboyIs there something wrong on how Drupal handles the libraries when there are two with the same/similar name?
Only the first one gets detected, as Drupal says in my Status report.
So I can't use Manual crop at all :/
It's more of a bug than a feature request.. I don't care if I have to rename folders & files as long as the module works :)
Comment #13
OnkelTem commentedNot sure if this is correct issue, but Manual Crop just don't work with 7.38: no libraries included at all. I haven't tried patching, I have libraries located just where README suggests.
Comment #14
OnkelTem commentedOh, I see now, such a beautiful things: version detection! Or at least an attempt to detect something. So nice, so brilliant, and so... bad that libraries don't want to support this detection.
Why imagesloaded is not loaded?
Well, basically because 3.1.8 version, which I have to use because of jQuery Update can not be detected with this code hardcoded to 2.1.1:
Why imgareaselect is not loaded?
Because the version recommended in README which is 0.9.10 never had 'imgareaselect.jquery.json' file on which another progressive piece of code relies:
No, I'm not against the progress, I just don't get why all this became necessary? Wasn't it enought to have those simple instructions in README — take that, rename to this? wit works woe..
Comment #15
OnkelTem commentedMeanwhile, use this dumb patch to resolve all the issue with libraries.
Comment #16
tessa bakkerLet restore all the changes and summarize the work that needs to be done for both libraries:
*
Create a version callback that works with all versionsChecked with all tags for both libraries, not needed*
Note the variants for different versions, no defaults (if possible)Already in patch**
leave the version tag intact for the folder name (if it is an older version?)Not supported* Change the hook_requirements where needed
* Test compatibility with modules like Masonry and Field Slideshow
* Test compatibility with newer versions of both libraries and add versions where possible
Comment #17
Anonymous (not verified) commentedI want to use the latest version of imagesLoaded ('cause that's the version other modules on my site use) but the version checking doesn't work with the latest version. So I've edited the patch to allow for having different versions and it seems to be working fine for me.
Comment #18
aaronbaumanhave been using #17 in production on several sites now to good effect.
rtbc +1
Comment #19
Anonymous (not verified) commentedComment #20
liquidcms commentedi still don't think this is correct.
i have latest -dev of manualcrop and from README.txt i have:
- https://github.com/odyniec/imgareaselect/archive/v0.9.11-rc.1.tar.gz
- sites/all/libraries/jquery.imgareaselect/jquery.imgareaselect.dev.js
and i still get Error imgAreaSelect Not installed error on status report.
Comment #21
joelhsmith commented@liquidcms I thought I had the same one installed too. It is confusing because they have the same name. See https://www.drupal.org/node/2113383#comment-11178683
This is the compatible version, not the github version: http://odyniec.net/projects/imgareaselect/jquery.imgareaselect-0.9.10.zip
Don't forget to rename it when you move it to the libraries forlder. It should not be dev.js it should be .min.js
Comment #22
dqd1.) I don't see why this is a "major" issue. Don't get me wrong but there are Drupal community agreed standarts to set an issue "major" and has been often misused from the users point of view in a way much too emotional. Practically this issue breaks no code nor is it breaking a side, nor is it in the scope of security concerns.
2.) The README points very clearly dependencies of the module and it is very common between modules of this kind, that you have to try around a little bit with naming and downloading versions. I can understand that it struggles the user, but I can just can tell you, for module maintainers this is often even more annoying, especially when the libraries used have confusing upgrade paths or update cycles.
3.) I personally refuse the last patch firmly, since I am an advocate for correct referencing naming conventions in any possible way to keep sort and order in code. And
jquery.nameofis much better than simplynameofIMHO.4.) I would like to discuss Drush support with the maintainer and the possible hosting of compatible library versions on Github, etc, if the authors lc (cc) allow that (look at other modules) which could prevent more of this issues in the future and what is maybe better maintainable with some automatisms.
Comment #23
fastangel commentedI recreate the patch from #17 for version 1.5
Comment #24
fastangel commentedUpdated with rename to jquery.nameOf
Comment #25
fastangel commentedUpdated fixing a little bug.
Comment #26
fastangel commentedFixed last problem to detect version on imgareaselect.
Comment #27
Chris Charlton+1. Needs review.
Comment #28
bisonbleu commentedPatch in #26 doesn't apply to latest dev version. See terminal output below. I ended up using the versions of the libraries found in the README.
Comment #29
bisonbleu commentedManually applied @fastangel's code in #26 against the latest dev. A revised and working patch is attached.
Manualcrop now works with either the suggested imagesloaded-2.1.2 or the latest version downloaded from Github, i.e. imagesLoaded 4.1.3.
p.s. This patch requires that you rename the library folder from e.g. imagesloaded-master to jquery.imagesloaded. See the README for more details.
Comment #30
bisonbleu commentedSetting to Needs review.
Update: Review is required because there's no guaranty that using version 4.1.3 instead of the recommended 2.1.2 will automatically work for all use cases. In other words, if you don't absolutely require 4.1.3, using 2.1.2 might be the prudent way to go.
Comment #31
eg2234 commentedPatch in #29 worked against 7.x-1.6+3-dev. Didn't test use of imagesLoaded 4.1.3.
Comment #32
jstollerThis is the patch from #29, updated to add support for imgAreaSelect version 1.0.0-rc.1.
Comment #33
jstollerRenaming issue for findability.
Comment #34
muaz7731I have test out the patch from #32.. it seems that the patch start out from docroot not from the folder of the module,in which make it a problem for me when trying to patch the module.
I have change the diff --git location to make it work for me. from:
diff --git a/docroot/sites/all/modules/contrib/manualcrop/... b/docroot/sites/all/modules/contrib/manualcrop/...to
diff --git a/... b/...I test it out with:
Drupal: 7.74
manualcrop: 7.14
imagesloaded: 2.1.2
imgAreaSelect: 1.0.0-rc.1
It works. I needed the new imgareaselect so that it can be properly used in mobile web. +1 for RTBC
Comment #35
muaz7731Comment #36
muaz7731re-edit the patch. having problem (Stripping trailing CRs from patch; use --binary to disable.)