Trying to debug a problem that turned out to be an overlong URL (myabe a point for future work) I discovered that the apachesolr_of module facets were still being requested even when that module was disabled. I'm working up a quick 1st pass patch, though wondering if there is a better approach.
In D7 I think there is a hook for when any module is disabled, but that doesn't help us for D5 and D6.
| Comment | File | Size | Author |
|---|---|---|---|
| #12 | apachesolr_suppress_disabled_facets_610656-D5.patch | 19.2 KB | claudiu.cristea |
| #5 | suppress-disabled-facets-610656-3.patch | 4.14 KB | pwolanin |
| #4 | suppress-disabled-facets-610656-2.patch | 0 bytes | pwolanin |
| #1 | suppress-disabled-facets-610656-1.patch | 2.11 KB | pwolanin |
Comments
Comment #1
pwolanin commentedComment #2
Scott Reynolds commentedin d6 there is hook_disable
http://api.drupal.org/api/function/hook_disable/6
Comment #3
Scott Reynolds commentedIn cck, the modules do a hook_disable and then a content_notify().
Content_notify allows content.module to clean up. I don't think you need that much but maybe ...
http://api.lullabot.com/content_notify
Comment #4
pwolanin commentedNow with some little APi wrappers too. Since they are a BC addition, I think ok, for 1.x.
Comment #5
pwolanin commentedoops - bad patch - d.o CVS seems to have flaked out
Comment #6
pwolanin commentedSure we could also do a general notify call instead of just specifically deleting facets.
Probably there is not much overhead to module_exists(0 so it may be worth jsut keeping that?
Comment #7
Scott Reynolds commentedHaven't tested but i like it
Positive you need that hunk?
Comment #8
janusman commentedCode looks good, need to actually install OG and try it out =)
Comment #9
janusman commentedIt works:
Before the patch:
With OG and apachesolr_og enabled, and the group filter enabled, a search request to Solr includes facet.field=im_og_gid
If the apachesolr_og module is then disabled, the search request still includes it.
After the patch:
When disabling the apachesolr_og module, the Solr request no longer includes that facet.
One caveat:
With the patch, when re-enabling apachesolr_og, one has to go to the "Enabled filters" tab and enable the OG facet again.
Is this expected behavior? If not a simple drupal_set_message() to the admin when disabling apachesolr_og could suffice =)
Comment #10
pwolanin commentedThe behavior may happen anyway if you submit the enabled filters form while the module is disabled, so this way at least it is consistently disabled.
I'm not totally certain we need the module_exists() check, but not every module is going to clean up after itself.
Comment #11
pwolanin commentedcommitted to 6.x-1.x
Comment #12
claudiu.cristeaPatch for DRUPAL-5--2.
Comment #13
claudiu.cristeaCommitted to 5.x-2.x.
Comment #14
robertdouglass commented#610656 by pwolanin, claudiu.cristea | Scott Reynolds: Fixed Facets requests for non-enabled modules.
Now in Drupal 6.x-2.x as well.