Installed apachesolr as per instructions. Running Drupal 6.12 on centos os with PHP 5.1.6. OG installed so enabled Apachesolr OG integration.

Enabled a bunch of filters. Go to "Search index" in apachesolr settings. I see:

The search index is generated by running cron. 26% of the site content has been sent to the server. There are 284 items left to send.

The server has a 4 min delay before updates are processed.

Number of documents in index: 66 (50 sent but not yet processed)

Numer of pending deletions: 1

When I click on "running cron" link:

admin/reports/status/run-cron?destination=admin/settings/apachesolr/index

I get a bunch of these errors:

warning: htmlspecialchars() expects at most 3 parameters, 4 given in apachesolr.index.inc on line 38.

I searched this issue queue for htmlspecialchars but only found this http://drupal.org/node/420290 which doesn't seem related.

Is there anything else I need to do, or is this a bug? Thanks.

Comments

somebodysysop’s picture

Title: htmlspecialchars() error » htmlspecialchars and taxonomy_admin_term_edit errors

I initially thought this might be related.

I should mention that I have taxonomy_access and og_subgroups modules installed as well.

I did a search for "test". Got the default Drupal search results screen. Then, I clicked on the "Search" tab. Got the white screen of death. The httpd server reports these errors:

[Sat May 16 14:18:59 2009] [error] [client 192.168.218.3] PHP Fatal error:  Call to undefined function og_subgroups_get_eligable_groups() in includes/common.inc(1645) : eval()'d code on line 15, referer: http://mysite.com/admin/settings/apachesolr/index
[Sat May 16 14:23:13 2009] [error] [client 192.168.218.3] PHP Fatal error:  Call to undefined function taxonomy_admin_term_edit() in /includes/common.inc(1645) : eval()'d code on line 2, referer: http://mysite.com/admin/settings/apachesolr/index
[Sat May 16 14:44:06 2009] [error] [client 192.168.218.3] PHP Fatal error:  Cannot access empty property in modules/apachesolr/Zend/Json/Decoder.php on line 239, referer: http://mysite.com/search/node/test

So, I unchecked the following filters:

Apache Solr OG: Filter by Organic Group
Apache Solr Search: Filter by taxonomy ...

Re-indexed site. Re-ran cron. Still get this error after running cron:

warning: htmlspecialchars() expects at most 3 parameters, 4 given in modules/apachesolr/apachesolr.index.inc on line 38.

Executed normal search. Clicked on "Search" tab. No longer getting errors there.

So, I guess this is another problem with OG and taxonomy filters. Any suggestions for these? I find no reference to "taxonomy_access", "taxonomy_admin_term_edit" or "og_subgroups" when seaching apachesolr issues.

pwolanin’s picture

Status: Active » Needs review
StatusFileSize
new874 bytes
new1.22 KB
new866 bytes

Ah, you must be using PHP < 5.2.3:

5.2.3  	 The double_encode  parameter was added.

http://www.php.net/manual/en/function.htmlspecialchars.php

Sorry about that - the intent is to be usable on PHP >= 5.1.4.

Attached are 3 possible patches - 2x simple ones and the more complicated. I think any one should alleviate the warning you are seeing with regard to this function.

The other errors are more mysterious.

somebodysysop’s picture

Status: Needs review » Fixed

I used the simple patch. Ran index and cron. Error appears to have disappeared.

Thanks!

Got some other issues, but will post them separately. Thanks for the fast post.

somebodysysop’s picture

Title: htmlspecialchars and taxonomy_admin_term_edit errors » htmlspecialchars errors
pwolanin’s picture

Status: Fixed » Needs review

This is not fixed unless the code is committed to CVS. Probably the simple one is good enough, though we should re-confirm, since it may double-encode & chars.

somebodysysop’s picture

Oops, sorry. It appears to be working. Anything in particular I should look for?

pwolanin’s picture

It should be working - main issue is if you see any double-encoding of &amp;

pwolanin’s picture

Status: Needs review » Fixed

committing "simple" patch to 6.x

Status: Fixed » Closed (fixed)

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