Hello!

Thanks for the great module. I really like it.

I have to say that I am usually not inclined towards hasty action, but html Purifier got me all excited and I neglected to be careful.

So, I managed to enable the module without copying the library files to the right place (I simply extracted the entire HTML Purifier file to modules/contrib/htmlpurifier/htmlpurifier3.whatever).

Pretty dumb move.

So when I enabled the module, I got this error:
Parse error: syntax error, unexpected ',', expecting '(' in /home/.sonora/www26313/usleap.org/modules/contrib/htmlpurifier/htmlpurifier.module on line 112

And when I attempted to visit the site (usleap.org) the site was giving me the same error.

I went to the database and deleted the cache_htmlpurifier table as well as the html_purifier row from the system table, and that brought the site up.

However, whenever I now install html purifier, I get the same error, and the site breaks again. Foolishly, I didn't back up the database before installing it.

I would really like to use this excellent-seeming module (I've tried it on a local server). What tables/variables can I delete from the database to be able to install the module freshly?

Thanks,
Jeremy

Comments

ezyang’s picture

This is probably a problem with a really early version of PHP that can't parse HTMLPurifier::VERSION properly. Find the line corresponding to the error and replace it with this:

    if (defined('HTMLPurifier::VERSION') && version_compare(constant('HTMLPurifier::VERSION'), '3.1.0-dev', '>=')) {

(i.e. change HTMLPurifier::VERSION to constant('HTMLPurifier::VERSION')). This bugfix will get into the next 5.x release. Thanks for the bug report!

glass.dimly’s picture

Hey, thanks!

I found two instances of the above text and replaced them

This worked and I don't have the error. I installed it and it all went fine.

Thanks!

I have a new bug, too.

I will fill out a new bug report because it seems unrelated.

Peace
Jeremy

ezyang’s picture

Status: Active » Fixed

Fixed in CVS.

Anonymous’s picture

Status: Fixed » Closed (fixed)

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

bmcraec’s picture

Drupal 6.10, trying to get SEO Checklist cleared up!

I've got a similar challenge with HTMLPurifier; I initially downloaded the full-fat version from HTMLPurifier.org, and expanded it in the modules folder. A total Newb thing, I didn't look closely enough, and thought it was the module. I then downloaded the HTMLPurifier 6.x-1.0 module, and enabled it.

OOOPS! Missing all the library files, but of course, I only see the initial message of "missing /modules/htmlpurifier/library/HTMLPurifier.auto.php" so I copy that file from the library in the full version to the newly-created correct path as indicated in the above error message, and then try again. Of course, it needs the whole library folder. So, I move the whole library folder to the /modules/htmlpurifier folder, and expect it to clean everything up. Fat chance! After a refresh, I get:


    * warning: array_merge() [function.array-merge]: Argument #2 is not an array in /home/costarm/public_html/update.php on line 174.
    * warning: Invalid argument supplied for foreach() in /home/costarm/public_html/update.php on line 339.

My Question: how to I get this module to work properly?

Apologies in advance for not having the coding skills or experience to get what's going on here!