Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
In duplicating a site from a dev server to a test server, I'm getting a status report error message "Leaflet library not found." Not sure why this is happening, as the Leaflet library and files did indeed get duplicated. I've also tried deleting and replacing the library, still same problem. Any suggestions?
Comment | File | Size | Author |
---|---|---|---|
#43 | Update-regex-expression-1954942-43.patch | 411 bytes | marcoscano |
#28 | 220px-Max_Weber_1894.jpg | 9.82 KB | Mac_Weber |
#14 | leaflet-fix_leaflet_library_location-1954942-14.patch | 4.13 KB | Mac_Weber |
#11 | leaflet-fix_leaflet_library_location-1954942-11.patch | 2.9 KB | Mac_Weber |
Comments
Comment #1
RdeBoerDouble check the path into to the libraries directory. Make sure all is in lower case.
Comment #2
dasjoi just had the same error
in my case, as i was working with a git repository, the reason was because leaflet contains a
.gitignore
file which will ignore the dist/*.js files.if you are working with a similar setup / commit all the files to a site-specific git repository, go to the leaflet/dist folder and do a
git add -f *.js
in order to add the files.Comment #3
kyletaylored CreditAttribution: kyletaylored commentedThis definitely helped. Thanks!
Comment #4
DerekAhmedzai CreditAttribution: DerekAhmedzai commentedI just had the same problem, commented out the
# dist/*.js
line in the .gitignore file.Comment #5
stinky CreditAttribution: stinky commentedI'm getting the same error message, am not using git so #4 doesn't work for me. Any other ideas?
Comment #6
stinky CreditAttribution: stinky commentedAny ideas on how to get this working?
Comment #7
RdeBoerOn a typical drupal install the path you end up with should be sites/all/libraries/leaflet/dist/leaflet.js
After you've downloaded the Leaflet package from CloudMade, you'll probably have a folder called "Leaflet-Leaflet-c1d410f" or a name like that.
Rename that folder to "leaflet" and move it to sites/all/libraries, so that you get the path shown above.
See also the Leaflet More Maps project page, which has these instructions and is probably a module you want to enable next. It has no downloads and no configuration - yay!
Comment #8
stinky CreditAttribution: stinky commentedI've already done what you've mentioned.
the Leaflet package from CloudeMade is in /sites/all/libraries/leaflet and I verified that there's the dist directory that contains leaflet.js.
and the drupal mod is in /sites/all/modules/leaflet
I have other libraries installed (e.g., ckeditor) and they work fine.
It's almost like it's not finding the correct path and document root, because the log files aren't pointing to the correct location.
For example, one location in the log file is appearing as
http://xxx.library.uaf.edu/dist/leaflet.js?v=0.4
and the correct path should be
http://xxx.library.uaf.edu/site7/sites/all/libraries/dist/leaflet.js?v=0.4
Comment #9
Nitty-Gritty CreditAttribution: Nitty-Gritty commentedThis is a fix to a similar but probably unrelated problem. My beginner mistake was to not have the module "Libraries" installed. So even though I had the js library installed at /sites/all/libraries/leaflet, I was getting an error message in the Drupal modules page "Requires: Libraries (missing)". Was very confusing for a while. Like I said, probably unrelated, but in trying to solve it I found this page, so perhaps it will help someone else.
Comment #10
RdeBoer@Nitty-Gritty:
Yep absence of the "sites/all/modules/libraries" MODULE as opposed to the "sites/all/libraries" library folder is a trap for young players... thanks for mentioning.
I have updated the Leaflet More Maps project page -- I don't have access to the Leaflet project page.
Rik
Comment #11
Mac_Weber CreditAttribution: Mac_Weber commentedWhy the library is located at
sites/all/libraries/leaflet/
dist/?It should be located at
sites/all/libraries/leaflet
/This extra folder
/dist/
is not provided by the zip file downloaded from http://leafletjs.com/download.htmlThen it breaks drush make because it is not a drupal standard to add extra sub-folders.
A patch is attached to change the code to look at
sites/all/libraries/leaflet/
.Comment #12
Mac_Weber CreditAttribution: Mac_Weber commentedComment #13
Chi CreditAttribution: Chi commentedIt was located there in 4.x branch of leaflet library.
Comment #14
Mac_Weber CreditAttribution: Mac_Weber commented@Chi the git repo should be used ONLY for building the library from source.
I'm changing other places that had references to the git repository and explaining it in
README.txt
in this new patch.Comment #15
Mac_Weber CreditAttribution: Mac_Weber commentedComment #16
burkeker CreditAttribution: burkeker commentedThe patch at #14 works for me in solving the library not found issue.
Comment #17
RdeBoerThanks burkeker for confirming....
A few changes going on here... as mentioned by Mac_Weber, one being that with the arrival of 0.6.x the directory structure no longer has /dist
...
Rik
Comment #18
Mac_Weber CreditAttribution: Mac_Weber commentedChanging it to RTBC again, as confirmed by 2 members.
Thank you.
Comment #19
afeijoYep, patch at #14 works! thanks
Comment #20
osopolarThanks, patch works for me too.
Comment #21
jwilson3Another vote for RTBC here. The Leaflet library has changed their structure and their recommended download method away from GitHub. Drupal.org has already caught up with this. It is time to get the patch in #14 into the module!
We'll also need to update the Leaflet module documentation on Drupal.org after this gets in.
Comment #22
chrowe CreditAttribution: chrowe commented#14 works great on 7.x-1.0-beta3
This is a serious blocker to getting the module working.
Comment #23
afeijoif the module maintainers are too busy to commit this or other improvements, me and mac_weber would be more than happy to help join the crew and take care of it.
just add him or myself and we'll commit and close this issue ASAP.
Comment #24
Mac_Weber CreditAttribution: Mac_Weber commentedSorry for disappointing you @afeijo, but I am really not interested on co-maintaining this module. It does not fit my needs and it would be too difficult to fix it. Moreover, talking with one of the maintainers he said they have no intentions on using Ctools and other things that would make the module have a better DX. Having all configurations done and saved on Views is also a problem form me, besides Leaflet module can only read values from geofield.
I have started a fork which I've been very excited coding and testing: Mapping Leaflet module. The link explains how Mapping Leaflet module is different than Leaflet module.
Read also my comment at DrupalCon Prague 2013 - Mapping Sprint
Everybody is welcome to help contributing. If you feel so, feel free to contact me.
Comment #25
DuaelFrPatch #14 still applies and needs to be commited more than ever.
LeafletJS is now in version 0.6.4 and this module only works with 0.6.2 releases (and older ones) from Github (not from the official website)...
Comment #26
jwilson3Lets bump it to critical, for wider visibility to potential new users getting snubbed by this in the issue queue, until maintainers get a chance to get this in.
Comment #27
RdeBoerPatch from #14 applied. Thanks Max Weber!
In summary:
When using Leaflet 7.x-1.x-dev or any official release after 7.x-1.0-beta3, first delete your existing sites/all/libraries/leaflet folder.
Then download the latest stable Leaflet JS library (e.g. 0.6.4 at the time of writing) from http://leafletjs.com/download.html and place it in sites/all/libraries, changing the folder name from leaflet-0.6.4 to leaflet.
The path to the essential .js file should thus be /sites/all/libraries/leaflet/leaflet.js.
Comment #28
Mac_Weber CreditAttribution: Mac_Weber commentedThank you @RdeBoer. I appreciate the git attribution, yet on the git comments you thanked this other guy, Max Weber:
Just joking =)
Comment #29
RdeBoerSorry... Mac.... you look so similar, easy to confuse ;-)
Rik
Comment #30
zilla CreditAttribution: zilla commentedseems to find it at /dist/ - but you should explain in peter rabbit english on the documentation that it is just the .js file, or all files/folders in leaflet (images css etc)
Comment #31
jwilson3The module documentation page on d.o still needs to be updated:
https://drupal.org/node/1645460
Comment #32
RdeBoer@jwilson# #31:
Thanks for pointing that out. I've updated the documentation on https://drupal.org/node/1645460.
Rik
BTW, it's something you could have edited too! Those documentation pages are accessible to everyone
Comment #33
RdeBoerComment #35
jcisio CreditAttribution: jcisio commentedShould we release beta4? As beta3 no longer works with the lastest stable version of LeafletJS, this is critical.
Comment #36
RdeBoerYep I agree. I've contacted the no.1 maintainer about this privately.
Comment #37
hsiyao CreditAttribution: hsiyao commentedthanks a lot jcisio for post #35!!!!
my first hurdle was the extra dist folder but when it still didn't work using any possible combination I was kind of lost....
for everybody else in my situation, here's a link to an older version that works with the current leaflet version
https://pypi.python.org/pypi/js.leaflet/0.5
Comment #38
jmpreston CreditAttribution: jmpreston commentedI'm trying to upgrade Leaflet 7.x-1.0 but it is failing to update.
At the end of the update I received a Requirements Problem status report with a variety of no problem messages but the Leaflet status is:
Leaflet not detected
The version of the Leaflet JavaScript Library library could not be detected.
I downloaded the Leaflet JS library ver .0.6.4 and .0.7.1 and tried them in the sites/libraries/leaflet folder and the /leaflet/dist/ folder but nothing removes this error.
I'm a newbie with Drupal and Leaflet but the map was working on our dev site before this upgrade so Leaflet was finding the directory and leaflet.js. I read the whole thread above and it seems that previous problems were corrected.
Any ideas what to do next? I don't see a config file for Leaflet.
Jim
Comment #39
andreystrelkov CreditAttribution: andreystrelkov commented+1 to jmpreston
Comment #40
timqallen CreditAttribution: timqallen commentedI'm having the same issue. I have tried the 7x-1.0 and the 7x-1.x-dev versions of the Leaflet module, and I have tried the 0.6.4 and 0.7.1 versions of the library. Any thoughts?
Comment #41
Anonymous (not verified) CreditAttribution: Anonymous commentedHello everyone!
I have (had) the same problem with updating the library to version 0.7.1. The current implemented regex pattern for the version number simply does not get the 0.7.1 (in my case).
So I had a look at the hook_library implementation in leaflet.module and found the trouble maker.
So I changed it to:
Now my even "maintenance" releases are covered and the library module does not run in circles anymore. :)
Hope that helps. If it does I can provide a patch or the module maintainer just updates the regex pattern.
Comment #42
timqallen CreditAttribution: timqallen commented@mikewink, thank you! Your code in #41 fixed part of my issue. Now my status report indicates that the leaflet library is found, and that is true for 0.6.4 and 0.7.1 versions. I seem to be having some other issue that causes the map to not display through views, but I'm working on sorting that out.
Comment #43
marcoscanoPerhaps the issue with 0.7.1 might be a different issue, but I can confirm that version 0.7.1 produced an error at the system status report (version not recognized) and applying the modifications indicated in #41 solved the error message for me.
I include here the patch file, for convenience
Comment #44
likewhoa CreditAttribution: likewhoa commentedAbove patch works for me with latest 0.7.x leaflet.
Comment #45
likewhoa CreditAttribution: likewhoa commentedJust noticed that patch in #43 is the same as in #2159309: Leaflet Maps no longer visible in iOS with uid=1, after upgrading Leaflet to 7.x-1.0 so I am closing this. People still having issues should look at the issue mentioned above.
Comment #46
likewhoa CreditAttribution: likewhoa commentedSince #2152423: Leaflet Library 0.7.1: The version of the Leaflet library could not be detected has the correct regexp to fix detection of the leaflet version, I will mark this as a duplicate to avoid confusion even though this bug was reported away earlier than #2152423: Leaflet Library 0.7.1: The version of the Leaflet library could not be detected. @maintainer feel free to reopen for whatever reason and apologies if this was uncalled for.
Comment #47
csanders CreditAttribution: csanders commentedPatch #43 worked for me as well. Using latest 0.7.x version.
Comment #48
AlfonsoAB CreditAttribution: AlfonsoAB commented@mikewink After updating the module, when trying to update the database, the erros started to show, and couldn't finish the update. Your patch worked like charm, thanks.
Comment #49
jmpreston CreditAttribution: jmpreston commentedThe fix in #41 looks easy enough but I can't find these lines in leaflet.module 7-1.0. I'm rather new to Drupal and don't understand what to do with the suggested patch in #43. Usually I hire a PHP coder but he seems to have disappeared so I'm trying to hack a solution for now.
Any help appreciated!
Jim
Comment #50
RdeBoer@Jim, #49
Just use the Leaflet dev snapshot 7.x-1.x-dev and you do not have to patch anything as it already has the patch in it.
Also use the 7.x-1.x-dev of the following modules (where desired) and you do not have to patch anything as all these versions were patched 2 days ago to align with the changes in Leaflet:
Leaflet More Maps
Leaflet MarkerCluster
IP Geolocation Views and Maps
Comment #51
jmpreston CreditAttribution: jmpreston commentedThey work, thanks RdeBoer!
Comment #52
mhamed CreditAttribution: mhamed commentedWith drupal 7.36
I ve got the same problem with the library not detected
downloaded the last version of the leaflet from the mother site
and the error disappeared
http://leafletjs.com/download.html
Comment #53
Daniel Wentsch CreditAttribution: Daniel Wentsch commentedProblem coming up again using Drupal 7.36 and Leaflet 0.7.3. No matter if Leaflet Module 7.x-1.1 oder 7.x-1.x-dev (2014-Oct-05).Sorry, my bad. My web server simply had not permissions to read leaflet.js which resulted in the version error message.
Comment #54
Road Kill CreditAttribution: Road Kill commentedThis is still a problem with the Dev version :( I spent about two hours trying to resolve the issues but I still get The version of the Leaflet JavaScript Library library could not be detected. I also used the dev version as recommended but this also failed.This is very disappointing.
Comment #55
ProfeHarol CreditAttribution: ProfeHarol commentedHola, Mi solución Fue:
1. Ir Informe + Informe de Estado
2. pon esto en tu url web: /#overlay=%3Fq%3Dadmin%252Freports%252Flibraries
3. Descargar http://cdn.leafletjs.com/leaflet/v1.0.2/leaflet.zip y descomprimir en sites/all/libraries/leaflet/
F5 para actualizar reporte...
Comment #56
yu3ver CreditAttribution: yu3ver commented+1,
And dev version too is not recognized in library.
Comment #57
GuillaumeDuveauWhen you download Leaftlet, leaflet.js is the minified version so it's harder to find the version number. You can just rename leaflet.js to leaflet.min.js (or delete it) and rename leaflet-src.js to leaflet.js.
Comment #58
Joel MMCC CreditAttribution: Joel MMCC commented@guix re: #57, doing that defeats the whole point of minimization, and will use more server and client resources and data. Better to change the
'file' => 'leaflet.js',
line in the patched version to use the'leaflet-src.js'
file for version detection purposes only. But perhaps better still…To all, especially maintainers: Please see my #2895968-15: Leaflet v1.3.1 and newer 1.x version not recognized. I'm a n00b at Drupal development, but I think we may be going about this whole version-detection thing the wrong way.