I can't get to admin/config/search/apachesolr/settings/solr/facets
It gives me this error.
Happened after I upgraded from beta9 to beta15.
Tried the dev versions and a few versions of facetAPI as well.
Everything else seems okay.
I've disabled almost everything else on the site as well.
I even uninstalled both apachesolr and facetapi modules and recreated my environment.
Any thoughts?
Recoverable fatal error: Argument 2 passed to FacetapiAdapter::getFacetSettings() must be an array, boolean given, called in /var/www/mysite/sites/all/modules/facetapi/facetapi.admin.inc on line 66 and defined in FacetapiAdapter->getFacetSettings() (line 532 of /var/www/mysite/sites/all/modules/facetapi/plugins/facetapi/adapter.inc).
| Comment | File | Size | Author |
|---|---|---|---|
| #34 | apachesolr-hook_info_fix-1418834-1.patch | 701 bytes | levialliance |
Comments
Comment #1
drewmacphee commentedI downgraded back to beta9 and the "old" enabled facets UI
admin/config/search/apachesolr/facets
And everything is working. I'd like to upgrade so I can rewrite my custom facets and such.
Comment #2
nick_vhI'd recommend you to go back to beta9 and remove it.
Then check your database and variables to verify if no facetapi stuff was left behind and reinstall it.
Did you run all the update.php scripts?
Moving it to the facetapi queue but please report back with more info
Comment #3
cpliakas commentedSo what combinations of the modules are being used here?
Comment #4
drewmacphee commentedDisabled beta9 then uninstalled.
Disabled facet 1.0rc1 then installed.
Checked variable, found nothing.
Checked most of the db for apachesolr or facet api..
There was a entity translation for facetapi in the DB so I removed that.
Deleted the apachesolr folder.
Reinstalled apachesolr beta15 and facetapi 1.0rc1
Same result
Comment #5
drewmacphee commentedSo I created a new solr environment (mysite_search) and deleted the default one and at first the facet link (button) led no where then when I flush cache the error showed again.
Then I hit back and I was suddenly on the page..
admin/config/search/apachesolr/settings/mysite_search/facets
You'll note it's not admin/config/search/apachesolr/settings/solr/facets
Must be something with the default solr environment that's setup on install??
Comment #6
cpliakas commentedBumping back to Apache Solr Search Integration, because if you track the code back you will see that the apachesolr_enabled_facets_page() is the wrapper function for the page callback, so we should determine what the $realm_name variable is and why the one it is passing to facetapi_realm_settings_form() is invalid.
drewmacphee, I need you to help debug here. Could you please provide the value of the $realm_name variable in apachesolr_enabled_facets_page()? If we determine that the Apache Solr menu is correctly passing the variables to Facet API, then we can bump it back here and continue debugging.
Thanks,
Chris
Comment #7
drewmacphee commentedSince I deleted the solr environment (the default one that was there on install) and created a new one the problem has gone away.
Now I can't seems to recreate the same problem.
So 2 questions:
1) Does it actually create a default solr env on install (It's been a few months since I first set one up)
2) Where does it store the solr env info? Maybe I overlooked it when I was cleaning everything out.
(If needed I'll take the time to remove what I have and try to reinstall to recreate the error)
Comment #8
nick_vhWould you be able to test this upgrade path?
Install Beta9 + facetapi
Mess around with the environment
Install Beta15 + facetapi latest
See if this reproduces the bug, if it does we all have something to look at.
Comment #9
drewmacphee commentedDidn't even need to do that.
Disable / Uninstalled beta15
Installed beta15
go to admin/config/search/apachesolr/settings
clicked on Facets ( which goes to http://beta.codet.com/admin/config/search/apachesolr/settings/solr/facet... )
Recoverable fatal error: Argument 2 passed to FacetapiAdapter::getFacetSettings() must be an array, boolean given, called in /var/www/mysite/sites/all/modules/facetapi/facetapi.admin.inc on line 66 and defined in FacetapiAdapter->getFacetSettings() (line 532 of /var/www/mysite/sites/all/modules/facetapi/plugins/facetapi/adapter.inc).
Comment #10
drewmacphee commentedFrom apachesolr_enabled_facets_page()
$realm_name is block
Comment #11
drewmacphee commentedSo again to fix the problem I create a new solr environment, made it default, flush cache.
This time I didn't delete the default solr install. Now when I go to it's facets page, it works too.
Comment #12
cpliakas commentedI took the steps illustrated in #9 and couldn't reproduce. I completely uninstalled the Apache Solr Search Integration module, re-installed it, and I was able to navigate to admin/config/search/apachesolr/settings/solr/facets?destination=admin/config/search/apachesolr/settings without any problems. If this cannot be reproduced on a fresh install of Drupal then we are probably going to have to close this as "cannot reproduce.". Are there any other modules or custom code that you have installed which could be causing the conflict?
Comment #13
drewmacphee commentedQuite a few, domain, entity translation, ubercart...
I have a work around now so I'm happy.
When I'm feel ambitious I'll try it on a fresh install but feel free to close it.
If it happens on a fresh install I'll reopen.
Thanks for your prompt reapplies, much appreciated.
Comment #14
cpliakas commentedNP, and thanks for your debugging on this. Look forward to any additional info you can provide as time permits.
Thanks,
Chris
Comment #15
drewmacphee commentedThe next time I flushed my cache the error came back.
I did manage to enable from facet blocks and they showed.. but as soon as the error is back, It also won't show the enabled facet blocks
Comment #16
drewmacphee commentedI tried a virgin install and it works fine.
I've disabled almost all the modules.. leaving ubercart 3.0rc4 as it's the products being indexed
There are 3 vocabs being used as facets
Comment #17
drewmacphee commentedBefore when I printed
From apachesolr_enabled_facets_page() $realm_name is block
but from facetapi_realm_settings_form on line 66 is passing $realm which is nothing
It looks like
function facetapi_realm_load($realm_name) {
$realm_info = facetapi_get_realm_info();
return (isset($realm_info[$realm_name])) ? $realm_info[$realm_name] : FALSE;
}
is doing something wrong
Comment #18
cpliakas commentedWeird. Can you confirm that "block" is being passed to facetapi_realm_load()? This is pretty simple function that invokes all hook_facetapi_realm_info() implementations and check if the array key exists. If this is failing then we have some big issues as the core Facet API module's hooks aren't getting invoked. Playing project ping-pong again since we are back in Facet API's court.
Comment #19
drewmacphee commentedI was adding debugging info to facetapi_get_realm_info(); and it makes it work again until I flush the cache
(I'm flushing the cache using the admin menu flush all caches)
As far as I can tell $realm isn't getting set which is causing my problem
Comment #20
drewmacphee commentedI don't get it.. this morning everything is working.
Comment #21
drewmacphee commentedI finally narrowed it down to the entity_translation module.
Comment #22
cpliakas commentedGreat! Any specifics, or should we move it to Entity Translation?
Comment #23
nick_vhComment #24
ruudmeesters commentedIt is probably somewhere in the entity_translation_upgrade part of it which provides permanent redirects for unavailable node translation. I switched that off and the facets are back as well as a working facets link in the apachesolr settings tab.
Comment #25
nick_vhMoving it to the Entity translation module
Comment #26
drewmacphee commentedHmm.. I haven't had entity_translation_upgrade enabled.
I have been having issues with entity_translation and title working together.
When they are both enabled I can't view any content (or go to the content page) with a title_field
EntityMetadataWrapperException: Unknown data property title_field. in EntityStructureWrapper->getPropertyInfo() (line 339 of /var/www/mysite/sites/all/modules/entity/includes/entity.wrapper.inc).
Also I've been getting the following when entity_translation is enabled and cron is run:
Warning: Invalid argument supplied for foreach() in RulesAbstractPlugin->rebuildCache() (line 1523 of /var/www/mysite/sites/all/modules/rules/includes/rules.core.inc).
Warning: Invalid argument supplied for foreach() in RulesAbstractPlugin->rebuildCache() (line 1523 of /var/www/mysite/sites/all/modules/rules/includes/rules.core.inc).
Warning: Invalid argument supplied for foreach() in RulesEventSet->rebuildCache() (line 695 of /var/www/mysite/sites/all/modules/rules/includes/rules.plugins.inc).
I'm sure this is all related.
Comment #27
drewmacphee commentedWell I've completely done a fresh version of the site and it seems that there are problems with i18n and entity_translation when apache solr beta15 is enabled.
When it's active:
When translation sets are active, there are errors whenever you hit any translate tab (for example on a block, or menu) (Something about get_string, is seems $strings in the translation object comes back blank)
When translation sets are off you can have block translation working, but you need translation sets for menus, paths and taxonomy translation.
When entity translation is installed it throws an error when loading any content with translation set to entity-translation. Even the on the admin/content page.
And the facet setting page is missing or throws my original error and all facets are missing.
If you turn off entity_translation you can get to the facet page and set active facets and they are there.
I went back to beta9 where everything is working together nicely.. however I need the results to return 9 items (for a nice 3 x 3 grid) and the blocks to appear on other pages, so I'd like to help get this solved.
I put this back on apache solr as it's the one piece in this puzzle that changed and caused issues with two other modules.
I'm going to press on and try to move up the betas to see where it breaks (I went back to beta9 as it was the last one I was using before this problem started.)
Comment #28
drewmacphee commentedEverything is fine in beta13 as well.. and I see beta14 and 15 are similar and the upgrade path is to skip 14.. so I'd have to assume this is only with the major changes in 14/15
Comment #29
drewmacphee commentedComment #30
nick_vhI assume this has something to do with entity_info? or even the entity_info_alter?
Could you please try and get more specific details to which function this entails?
Thanks!
Comment #31
levialliance commentedWild stabs in the dark after a half hour of investigation, but is module_hook_info() supposed to be reentrant?
If you clear the cache and trace what happens, you get something like this:
module_implements('entity_info') call still seems to return the correct data, and presumably when it goes back up the call stack it finishes the rest of the hook_info().
Whatever the exact cause, the net result is that hook_hook_info() for modules after apachesolr (ie facetapi) get skipped and so hooks in a group are not visible.
My hacky temporary workaround:
Since the apachesolr_hook_info() call is now last (or close to it) the rest of the hook_info()s are called correctly.
Edit: That was with D7.12 and apachesolr 1.0-beta16+3-dev
Comment #32
levialliance commentedThis is actually the same issue as:
http://drupal.org/node/1415278
http://drupal.org/node/1410256 (this one not exactly the same but caused by the limitation in core)
The 'proper' solution is to fix hook_hook_info in core to be properly reentrant. A better workaround than changing apachesolr's weight is to move the entity_get_info() into a hook_hook_info_alter():
Comment #33
nick_vh@levialliance Can you make a proper patch for this? Easier to apply :-)
Comment #34
levialliance commentedPatch against git 7.x-1.x branch attached
Comment #35
nick_vhGo testingbot, go!
Comment #36
nick_vhCan someone tell us if this patch works as expected?
Comment #37
cspitzlayThe patch works for me. I don't get the error
any more.
No ill effects so far.
Comment #38
cspitzlayI'm not sure what level of tests and or experience is required to
promote an issue to "reviewed and tested by the community"
but the explanation makes sense to me and the
patch solved my problem which was Exceptions being thrown on all pages
when both title and apachesolr were active...
Comment #39
nick_vhLooking good then, Will commit asap :-) Just got back from a small holiday and I'll look into this
Comment #40
nick_vhCommitted to 7.x-1.x. I should get back to the 6.x-3.x branch to commit all those backported patches! :-)
Comment #41
cspitzlayCool, thanks.
Comment #42
dave reidThis does not apply to anything other than Drupal 7.
Comment #43
nick_vh