I've installed the GeSHi filter module on my Drupal 7 site, and am having issues with getting it to detect the presence of the GeSHi library. To rule out my own idiocy, the steps I've taken are;

  1. Downloaded GeSHi 7.x-1.0-alpha2
  2. Downloaded Libraries API 7.x-2.x-dev
  3. Downloaded newest version of 1.0.x branch of GeSHi library (1.0.8.10)
  4. Copied modules to /sites/all/modules/...
  5. Copied GeSHi library folder to /sites/all/modules/geshifilter/...
  6. Installed modules etc

But no dice - the README.txt states that;

The general GeSHi Filter settings can be found by navigating to:

administer > site configuration > geshifilter.

Set the path to the GeSHi library on that page, if it is not detected automatically already.

However, I don't get any option to manually set the path, just an error message telling me that the library was not detected.

I've double-checked my install and re-installed, so any tips would be appreciated.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

calmer1982’s picture

I am having the same problem, I do not have the option to set the manual path for the GeSHi library. I was using Windows 2003 server, could this be the problem? or is it just a bug with drupal 7?

It must be part working as it is changing to [geshifilter-blockcode language="Javascript"]

I am trying to find out what the function libraries_load('geshi'); is trying to do and I will see if you can change the function to enter the location of the GeSHi library.

I will let you know how it goes.

calmer1982’s picture

OK, I have a every rushed and extreme fix, but it has worked :)

First:
add the line
include_once('geshi/geshi.php');
to the top of every *.inc and *.module files in the root of geshifilter folder

Then you need to replace in all files in the root of geshifilter folder the following:
Replace All: (!$geshi_library['loaded'])
With: (/*!$geshi_library['loaded']*/0)
And
All Replace: ($geshi_library['loaded'])
With: (/*$geshi_library['loaded']*/1)

You can see it working at http://www.martinjamesholland.co.uk/?q=node/14

But there must be a better fix then this :)

calmer1982’s picture

You also need to change the following line in include the languages:
$geshi_library['library path'].'/geshi'
to
drupal_get_path('module', 'geshifilter') . '/geshi' .'/geshi'
in the file geshifilter.inc

Once all has change are made, you may need to un-install the filter then apply it again.

boombatower’s picture

Status: Active » Postponed (maintainer needs more info)

You can configure libraries module to look where ever you want, but it defaults to libraries directory within a site. For example sites/all/libraries or sites/default/libraries. Which is nice since it lets you keep the integration code and library in separate locations.

So geshifilter would be .../libraries/geshifilter. See if that works.

homer777’s picture

I have the exactly same issue. Frustrated.

boombatower’s picture

Did you place it in sites/all/libraries/geshifilter or any other sites/.../ as suggested in #4?

homer777’s picture

FileSize
21.18 KB
39.28 KB

Yes, as the attached pictures show.

homer777’s picture

libraries-7.x-1.0.zip is also extracted in /public_html/sites/all/libraries, as shown in the attached picture.

boombatower’s picture

libraries 2.x as the project page notes...

homer777’s picture

calmer1982, your fix does not work in my case. I do not know why.

openWeb’s picture

This issue seems to exist only if the latests stable geshi-version is used. Had this to and after downgrading geshi to version 1.0.2 everything works as expected...

Seems to be some API-changes (or a global?) in the geshi-code.

boombatower’s picture

This module doesn't support the 1.1.x line of geshifilter as noted on project page.

openWeb’s picture

The issue was raised with geshi version 1.0.8.10... So no 1.1.dev used here.

I tried most versions on geshi-site (versions <1.0.2 don't have the GESHI_VERSION-global and therefor fail from beginning...)

aliech’s picture

Hi all!

I have some problem, it's seems like bug in cache method of Libraries API module. After cleaning cache all works fine.

homer777’s picture

Nobody has tried to solve it yet? Can anyone provide info for an module to provide similar functionalities of GeSHi? Thanks!

boombatower’s picture

Huh? It works fine if you use the appropriate version of the geshi library either using the drush make script or instructions on project page.

boombatower’s picture

Version: 7.x-1.0-alpha2 » 7.x-1.x-dev
Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)

Is this still an outstanding issue?

openWeb’s picture

I think we could close this one... Seems to be a caching issue indeed. After cleaning the cache more then 2 times, this issue seems to be gone.

brianhogg’s picture

Status: Closed (cannot reproduce) » Needs review

I'm having the same issue, in that no matter where the Geshi folder was located Geshi Filter module could not detect it (v1.8.10 initially then v1.0.2, which perhaps explains the problem). I cleared all the caches multiple times from Administration > Configuration > Performance, along with visiting Administration > Reports > Status Report (which apparently forces a rescan of the library locations). I ended up using the Syntax Highlighter module instead which worked first time with the relevant library in sites/all/libraries:

http://zugec.com/70-how-use-syntax-highlighter-module-drupal-7

I'm new to Drupal so if there is another cache location or something else I'm missing would be great to know, otherwise Syntax Highlighter is a nice alternative. Thanks!

Anonymous’s picture

Status: Needs review » Needs work

Subscribing, problem for me too on 7.x-1.0 and libraries 2.x-dev. (used version of the library from the makefile too). 2x `drush cc all` fixed it..

Changing status too since I don't see any patch to review. Might not be the module's fault but a Drupal 7 bug though?

boombatower’s picture

Status: Needs work » Closed (works as designed)

"drush cc all" fixed it, yes clearing cache is necessary for many parts of Drupal and is also used by the Libraries project. This isn't a bug....

openWeb’s picture

at least it's not a bug in the geshi-module... the cache in d7 really is somewhat strange. no matter if you develop or simply use modules/themes/templates: most time you have to clear the cache more than once. best thing is to use the "drush cc all"...

homer777’s picture

I am still having the same issue with GeSHi Filter. It is NOT because I did not get the correct versions. I followed the instructions. I have many year IT experience, even though I am not good at PHP. So trust me.

Yes, Syntax Highlighter is great. It works for me the first time. Many thanks to brianhogg: http://zugec.com/70-how-use-syntax-highlighter-module-drupal-7

boombatower’s picture

Is everyone sure they are clearing the cache? If you put the geshi library there before enabling the module or hitting any drupal pages that may remove the need to clear cache since it will do so on install.

kenjiru’s picture

I have the same problem.

xoran99’s picture

Indeed, I had the same problem. Clearing all caches fixes the problem (Administer > Configuration > Performance > Clear All Caches), but this is not an obvious step. I suppose this would actually be trouble with the Libraries module, since Libraries keeps a cache but this module does not, to my knowledge...

boombatower’s picture

The libraries module does indeed cache that information. Another options is to make sure that you install the library before enabling the module...since it is a dependency.

stieglitz’s picture

I was having the same problem and realized I had extracted the tar to the wrong folder. Correcting it to libraries/geshi/geshi.php solved the problem. Correction: I was wrong. Still getting this error: function libraries_load() in sites/all/modules/geshifilter/geshifilter.module on line 231 Using geshi-1.0.8.10

boombatower’s picture

libraries_load() is undefined? if so please use libraries 2.x-dev as the project page indicates.

goivvy’s picture

from libraries_get_libraries() you can see that libraries module search following directories:
drupal_root/libraries
drupal_root/sites/all/libraries
and others

place geshi folder into drupal_root/libraries and everything would be ok

boombatower’s picture

sites/all/libraries
sites/[some_site]/libraries

are definitely preferred

jallenb’s picture

I had the very issue as described in the original description. The issue is with the Libraries module, not GeSHi Filter.

Drupal 7.9
Libraries (libraries) Module Enabled 7.x-2.0-alpha1
GeSHi Filter (geshifilter) Module Enabled 7.x-1.0

After trying different paths and clearing the cache with 'drush cc all', I found the Libraries module could only locate the GeSHi library after placing it in sites/default/libraries/geshi. It didn't appear to be looking in sites/all/libraries at all.

# drush libraries-list
 Name   Status        Version  Variants  Dependencies 
 geshi  OK            1.0.8.1  -         -            

I'm happy to see it working.

danoprey’s picture

Confirming it worked for me after a few clears of the cache (through the UI):

sites/all/modules:
geshifilter-7.x-1.x-dev.tar.gz
libraries-7.x-2.0-alpha2.tar.gz
sites/default/libraries:
GeSHi-1.0.8.10.tar.gz

un-tared, obviously.

Keyser Soze’s picture

It worked as soon as I installed the Libraries API.

It is mentioned in the geshifilter modules page, stupid of me to have missed that. I did everything mentioned earlier in this page, and when none of those worked, I started reading the module description like a good boy.... :)

The 7.x branch requires the Libraries API (2.x-dev). A drush make file is also included that will download both the libraries API and the geshi dependency.

Hope this helps some people...

John Bickar’s picture

Version: 7.x-1.x-dev » 7.x-1.1
Status: Closed (works as designed) » Needs work

When following the instructions in README.txt, I am unable to get the GeSHi Filter module to detect the geshi library when it is placed in the module directory. (I do not have write access to the libraries directory on this particular Drupal install.)

geshifilter-7.x-1.1
libraries-7.x-2.0-alpha2
geshi library is installed in sites/default/modules/contrib/geshi/ like so:

jbickar@servername:/var/www/drupalsite/public_html/sites/default/modules/contrib/geshifilter$ ls geshi
contrib  docs  geshi  geshi.php

I get the error message "The GeSHi filter requires the GeSHi library (which needs to be downloaded and installed seperately)" at admin/config/content/formats/geshifilter even after clearing the cache several times.

I have confirmed on a separate install that installing the geshi library within sites/all/libraries (e.g.) works, so is it possible that the option to install the library within the module directory has been removed?

soxofaan’s picture

Status: Needs work » Fixed

so is it possible that the option to install the library within the module directory has been removed?

indeed, it was removed by:

commit 79729a1632c60e8177747a5cfe092c15ab329aaf
Author: Jimmy Berry <jimmy@boombatower.com>
Date:   Wed Apr 13 05:33:56 2011 -0500

     #1125804: Support libraries API.

I updated the installations instructions in the README accordingly (commit 94f3671083)

I do not have write access to the libraries directory on this particular Drupal install.

Do you have write permissions to sites/default/libraries or sites/yoursite.com/libraries ? that should work as well, as far as I know.

Status: Fixed » Closed (fixed)

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

ingram87’s picture

Clearing the cache fixed this issue for me as well.

_gramur’s picture

Follow #37 (soxofaan) advice by making sure you have write permission to the folder. After that clear cache and the issue should be resolved.

Cheers.

pritamprasun’s picture

faced the same issue but resolved.
Suggestion:
Follow the readme.txt instruction carefully.
check the permission of the library directory.
clear the cache.

sercandemir’s picture

#27 worked for me