This is a problem with jQuery Map Hilight module becuse it makes the module unusable if files are outside of the site root. While testing modules for a live site I run on a localhost and I also implement/test modules/features to my production sit first on a cope of the site on a local host for practical reasons. The actual location of the plugin is copied in to the files directory /localhost/testsitename/sites/all/libraries.

but because jq_maphilight.module uses the getcwd() to build file paths , jq_maphilight.module thinks this path is located at: /localhost/sites/all/libraries/jquery.maphilight.min.js

when it Is actually here:/localhost/testsitename/sites/all/libraries/jquery.maphilight.min.js

And the plug in can not be found.

I have hacked the jq_maphilight.module to work by eliminating getcwd() and hard coding the actual plug in path like:

/**
 * Check if the jquery.maphilight.min.js file is available.
 */
function _jq_maphilight_available() {
  if (module_exists('libraries')) {
//   $available = libraries_get_path('jquery.maphilight', TRUE) ;//. '/jquery.maphilight.min.js';
    $available ='/localhost/testsitename/sites/all/libraries/jquery.maphilight.min.js';
//    if (is_file(getcwd() . $available)) {
      return $available;
//   }
  }
  return false;
}

For anybody looking to solve this problem this is not the fix it is just a tool to help under stand the bug.

A similar bug and I think fix for a different module can be found at http://drupal.org/node/675910 as a example.

Comments

WorldFallz’s picture

This was introduced as part of the d7 upgrade which was done by someone else-- i'm requesting clarification from them in #1030332: D7 ver.

In the meantime, you can simply change if (is_file(getcwd() . $available)) { to if (is_file($available)) { (which is the way it was in the d6 version). No need to hardcode the path.

13rac1’s picture

Status: Needs work » Active

It has been five months since I worked on this modules. I haven't a clue why I added the getcwd(). Feel free to remove it.

No patch attached for review, so I've changed status.

WorldFallz’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.