I received the message in the Status Report about installing Respond.js for use with Libraries API. It said it was using the copy from the module's folder. The sub text/description says "Please install Respond.js in ." There's no path specified. When I install the linked file "respond.min.js" into sites/all/libraries/respondjs/lib/respond.min.js, I then get the error "Respond.js is not correctly installed. Please install Respond.js in the repsondjs folder under /lib.

Couple issues here:

  • Minor typo: should be "the respondjs folder" and not "the repsondjs folder"
  • What IS the correct path? Should be specified in the help text.
  • Is respond.js suppose to be "respond.js" or "respond.min.js"?
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

rupl’s picture

The correct path for installing libraries in Drupal is never in a module's directory. If I made a note saying otherwise then you're right I need to change that.

As for your error can you confirm that you actually enabled the Libraries API module? This might be similar to #1919796: Modernizr module chokes on Libraries API 1.x where respondjs.module needs to more thoroughly check that Libraries is up to date and enabled.

muppel’s picture

Got the same problem. Libraries API enabled. Installed "respond.min.js" in "sites/all/libraries/respondjs/lib" and in "sites/all/libraries/respondjs". Same error messages. Where do I have to install the library and what's the correct name???

muppel’s picture

Solved. The respond.js file was named respond.js.htm ... After correcting this error, the files where recognized propperly.

nkraft’s picture

HI,
I just spent like 20 minutes trying to figure out the correct path / file name to place the respond.min.js script -- can i offer to write some instructions on the project page for you, so we spare others the same issue?

I know its a small thing, but when the status page error message still is written incorrectly, and there are no specific instructions on the project page, it can be terribly irksome to do something which should be very simple and straightforward.

Let me know. I'd be happy to coontribute a bulleted list set of directions to the Project page.

thanks!
Nathaniel

nkraft’s picture

PS.

For posterity, in Drupal 7:

1. download and install the module.
2. download the Respond.js script here: https://github.com/scottjehl/Respond/blob/master/respond.min.js
3. Save the js file (and it should be named respond.min.js) to /sites/all/libraries/respondjs/ (respondjs is a new folder you create inside the libraries folder)
4. Check your Drupal Status Report page again (/admin/reports/status)
5. The respond.js message on the Status Report page should now be green, and it should say "Respond.js script enabled"

If you're still experiencing problems, make sure you've set the correct permissions for the module on your Drupal permissions page:
/admin/people/permissions#module-respondjs

rupl’s picture

Title: Respondjs doesn't recognize correct folder » Respond.js module should provide proper installation location for upstream library

By all means create a documentation page! If you are registered on drupal.org you are eligible to create/edit them.

I have created a documentation stub and the module's homepage now links to it. Feel free to update the content however you please.

As an aside, it's way simpler to install using Drush. Here are the instructions I always use to install this module, which is why the mistakes in the admin UI went unnoticed for so long:

drush en libraries
drush en respondjs

And that's it. Drush installs the library for you ;)

hwasem’s picture

Thank you, nkraft, for the explanation! I've been looking all afternoon for this.

zet’s picture

I've done the same steps as nkraft described above, but the warning persists

Respond.js script
Respond.js is not correctly using Libraries API
Please install Respond.js in . The module is using its included copy at sites/all/modules/respondjs/lib

I've even put respond.main.js, Respond.main.js, Respond.js, respond.js in all the 3 folowing directories: sites/all/libraries ,
sites/all/libraries/respondjs, sites/all/libraries/respondjs/lib

Everything is the same.

Yes, I flushed all the caches.

Later edit: I see the code that gives the above warning in the admin/reports/status page is :

 // If Libraries API is enabled but respond.js is not found within the sites/all/libraries folder
    // report a warning. The module will fall back to its included copy so this isn't a showstopper.
    if (function_exists('libraries_get_path') && strpos($library_path,'libraries/respondjs') === FALSE) {
      $requirements['respondjs']['value'] = t('Respond.js is not correctly using Libraries API');
      $requirements['respondjs']['severity'] = REQUIREMENT_WARNING;
      $requirements['respondjs']['description'] = t('Please install <a href="https://raw.github.com/scottjehl/Respond/master/respond.min.js">Respond.js</a> in <b>'. libraries_get_path('respondjs') .'</b>. The module is using its included copy at <b>'.drupal_get_path('module','respondjs') .'/lib</b>');
    }

from sites/all/modules/respondjs/respondjs.install

and the empty path is given by the libraries_get_path('respondjs') function

rupl’s picture

Looking at that .install code, I also misused the t() function pretty bad too. I'm pretty busy at DrupalCon Prague this week but if someone posts a patch I'll review it and cut a new release of the module.

I think the conditional might be wrong. I don't have time to sit and test this but could someone negate the following conditional on a Drupal site that is having problems?

if (function_exists('libraries_get_path') && strpos($library_path,'libraries/respondjs') === FALSE) {

Change it to:

if (function_exists('libraries_get_path') && strpos($library_path, 'libraries/respondjs') !== FALSE) {

For the record, here are the steps I would use if I did this manually:

  1. Install/enable Libraries API and Respond.js modules
  2. Download respond.min.js and put it in this folder: sites/all/libraries/respondjs. Do not create a /lib folder.
  3. Turn CSS aggregation on to allow respond.js to work properly, since it can only replace styles referenced via <link> tags and cannot process @import directives.

Thanks for the error reports, everyone!

zet’s picture

rupl, seems that you are right.
Negation of that conditional and reinstall seems to solve the problem of the wrong warning.

zet’s picture

Status: Active » Needs review
Issue tags: +Quick fix, +patch
FileSize
1.06 KB

Here is a small patch to make it work.

rupl’s picture

I tried this out and realized that changing the conditional makes the warning go away, but it isn't properly representing what the user needs to do if Libraries API is enabled. Here's the patch that I committed to dev, let me know if this works by giving an RTBC:

edit: whoops, I did not commit this to dev. please review then I will commit.

nkraft’s picture

Good to know about the Drush install! I use Drush for personal projects, but am unable to for my professional projects through my companies, hence I tend to run into things like this. I'll see if I can add a page at some point... i had completely forgotten about this till today!

nkraft’s picture

Zet, i know your post is several weeks old. Did you get everything working?

rupl’s picture

@nkraft, his patch was actually removing the warning entirely, if you could test #12 I will commit

dovran’s picture

Issue summary: View changes

Thank you rupl your coment

I have made as have been described above comments number 9

All it has turned out

Thanks

rupl’s picture

Status: Needs review » Fixed

Would have been cool to get someone experiencing the problem to test and confirm the patch, but I committed to dev anyway.

And again, if someone wants to really help out your fellow Drupal devs, please write some docs. Even if you just transcribe other peoples' comments from this issue it helps a lot. We're all in this together.

hwasem’s picture

I updated the docs at the link provided in #17. Thanks!

rupl’s picture

@hwasem you are a cool person. thank you!

RPilkington’s picture

The 'respond.min.js' that needs to exist at 'sites/all/libraries/respond' is . . .

HERE: "https://github.com/scottjehl/Respond/blob/master/dest/respond.min.js"

NOT here: "https://raw.github.com/scottjehl/Respond/master/respond.min.js"

---
I'm new at this, but I just

  1. Tested this with a MAKE (build/install)
  2. Enabled Aggregator and
  3. Selected [config/performance] "Aggregate and compress CSS files."


Result: Respond.js script -----> Enabled

I did NOT test Config/Media usage. I don't even know what it's for (yet), but I did install via Make. ;-)

Cheers, Rick

Here is the [clipped] make I used. Note: Directory 'respondjs' instead of 'respond' [no consequence, I think.]

; makeSTART: respond.js
; ---------------------
libraries[respondjs][download][type] = "get"
libraries[respondjs][download][url] = "http://github.com/scottjehl/Respond/archive/master.zip"
libraries[respondjs][directory_name] = "respondjs"
libraries[respondjs][type] = "library"
; Single file download
libraries[respondjs][download][type] = "get"
libraries[respondjs][download][url] = "https://github.com/scottjehl/Respond/blob/master/dest/respond.min.js"
libraries[respondjs][download][filename] = "respond.min.js"
; makeEND: respond.js

rupl’s picture

Version: 7.x-1.2 » 7.x-1.x-dev
Status: Fixed » Needs work

lol thanks for the report. This is why testing patches is part of open source software, per my comment in #17. I'm gonna let someone else fix this and post a patch. It's an utterly trivial change, so it's a great opportunity for someone to try their hand at contribution. Have at it!

RPilkington’s picture

Updated Respond.js Install Doc at https://drupal.org/node/2032637; revised as noted at #20 above https://drupal.org/comment/8602221#comment-8602221.

RPilkington’s picture

Component: Code » Documentation
Assigned: Unassigned » RPilkington
Status: Needs work » Closed (fixed)

Documentation Error. Fixed.

RPilkington’s picture

The comment at this link answers why this is a Documentation error.
https://drupal.org/comment/8701505#comment-8701505.

rupl’s picture

Thanks for updating the docs, yes this can be closed AFAICT :)