I read through the install and grabbed the most recent SolrPhpClient (Built from 5/4/11) and kept getting the following error when I tried to add my Solr server (/admin/config/search/search_api/add_server):
Recoverable fatal error: Argument 1 passed to Apache_Solr_Response::__construct() must be an instance of Apache_Solr_HttpTransport_Response, string given, called in /yourpath/sites/all/modules/contrib/search_api_solr/solr_connection.inc on line 117 and defined in Apache_Solr_Response->__construct() (line 97 of /yourpath/sites/all/modules/contrib/search_api_solr/SolrPhpClient/Apache/Solr/Response.php).
I switched this out for the older SolrPhpClient(Built from 11/9/09) and the error went away add I was able to add my Solr server without incident.
I searched for topics around this issue but didn't see anything related so I wanted to post in case anyone else got hung up.
| Comment | File | Size | Author |
|---|---|---|---|
| #19 | 1184002--new-solr-client-version-19.patch | 10.62 KB | drunken monkey |
| #9 | 1184002--new-solr-client-version-9.patch | 11.85 KB | drunken monkey |
Comments
Comment #1
drunken monkeyOh, didn't realize there was finally a new release. Thanks for reporting!
I now updated the INSTALL.txt file to reflect that the newer version won't work. However, I'll leave the issue open for now, as taking a look at the newer version might be interesting. Maybe adapting to it is a better option than writing a new connection system as suggested in #1032848: Store SolrPhpClient in Libraries folder.
Comment #2
LSU_JBob commentedsubscribe
Comment #3
Shadlington commentedSubbing
Comment #4
pacunar commentedsubscribe
Comment #5
pacunar commentedsubscribe
-- sorry, double post!
Comment #6
Fidelix commentedSubscribing...
Comment #7
jbguerraz commentedSubscribe
Comment #8
mnlund commentedsubscribe
Comment #9
drunken monkeyOK, with that much feedback, I practically have to fix this, don't I?
I still think writing my own solution would be the better alternative, but as long as I don't have the time for that, it can't hurt to support both the old and the new version of SolrPhpClient. Since they are (at least in some internals – which I have regrettably overriden) incompatible, I had to use a little "hack" to decide which version of the code to use, but it seems to work.
Please test whether the module works both with the old and the new version of SolrPhpClient with the attached patch applied. You should also get nice little warning when r22 is installed. (Or would it be better to leace them out – after all, it should work equally well with both versions? On the other hand, I might decide to drop r22 support later, if I don't write my own client, and then a warning period would be good …)
Comment #10
tomogden commentedAfter getting the error message reported above, I installed the patch, but it resulted in another set of errors.
Comment #11
drunken monkeyIf you have a call to the
Apache_Solr_Responseconstructor at solr_connection:117, you apparently didn't apply the patch correctly.Without patch:
With patch:
But thanks for taking the time to review! Apparently no-one else is willing to.
Comment #12
presleyd commentedIt installed ok and seemed to work until I saved a new server and got a WSOD with the following error in the server logs:
PHP Fatal error: Class 'SearchApiSolrHttpTransport' not found in /mypath/sites/all/modules/search_api_solr/solr_connection.inc on line 62, referer: http://mysite/admin/config/search/search_api/add_server?render=overlay
I am using the dev version from 2011-07-28 so I had to patch it by hand. Other info: PHP 5.3, Solr 3.3
Comment #13
Aldus commentedsubscribe
Comment #14
drunken monkeyDid you clear the cache after applying the patch? It seems like the class in includes/solr_httptransport.inc isn't found by the Drupal autoloader.
Comment #15
Refineo commentedsubscribe
Comment #16
presleyd commentedOk, looking at it further it seems that the solr_httptransport.inc file wasn't inside the includes folder. I'm not sure how that happened. So far so good.
Comment #17
drunken monkeySo would you say everything works for you and this can be committed, as far as you are concerned?
@ Others: Please, don't just subscribe, review!
Comment #18
presleyd commentedAs far as I can tell. PS This isn't hard to test out folks!
Comment #19
drunken monkeyThanks for testing!
Re-rolling the patch – would be good, if someone else could test, too, but otherwise I'll just commit it in the next few days.
Comment #20
Refineo commentedHi, I patched (manually) this 1184002--new-solr-client-version-19.patch and installed SolrPhpClient.r60.2011-05-04.
This causes WSOD when trying to
on admin/config/search/search_api/server/localhost_solr_server
Comment #21
presleyd commentedAbove it was noted that you should make sure you clear the cache after patching.
Comment #22
Anonymous (not verified) commented+1
Tested it with a few thousand custom entities, seen no problems.
Comment #23
drunken monkey@refineo: Does clearing the cache after patching help? Otherwise, I need more information on the WSoD, when it exactly occurs, etc.
@morningtime: Thanks for testing! Let's just see whether refineo's problems remain.
Comment #24
Anonymous (not verified) commentedOk, I had an existing server/index, just applied your patch and copied the new Solr version. Then I did Clear all caches, but also cleared my index before re-indexing. I didn't see a WSOD or any issues.
Comment #25
Refineo commentedClearing the cache didn't help but the WSOD might be of another reason.
Unfortunatelly I won't be able to retest this patch today. Please don't wait for me if you've already tested successfully.
Comment #26
drunken monkeyOK then – committed.