When visiting a search page, I get lots of the following messages:
# Warning: Invalid argument supplied for foreach() in search_api_facets_paths_url_outbound_alter() (line 100 of …/search_api_facets_paths/search_api_facets_paths.module).
# Notice: Undefined offset: 1 in search_api_facets_paths_url_outbound_alter() (line 98 of …/search_api_facets_paths/search_api_facets_paths.module).
# Notice: Undefined index: f in search_api_facets_paths_url_outbound_alter() (line 101 of …/search_api_facets_paths/search_api_facets_paths.module).
One effect of this is that all facet links are rewritten, not only those of taxonomy terms — and they are rewritten to have no effect at all. The attached patch should fix this.
Comment | File | Size | Author |
---|---|---|---|
search_api_facets_paths.warnings.patch | 752 bytes | drunken monkey |
Comments
Comment #1
Shadlington CreditAttribution: Shadlington commentedI also get:
"Warning: Invalid argument supplied for foreach() in search_api_facets_paths_url_outbound_alter() (line 100 of /var/www/sites/all/modules/search_api_facets_paths/search_api_facets_paths.module).
Warning: Invalid argument supplied for foreach() in search_api_facets_paths_url_outbound_alter() (line 100 of /var/www/sites/all/modules/search_api_facets_paths/search_api_facets_paths.module)."
EDIT: Actually its way more than just that, depending on the search...
Comment #2
Shadlington CreditAttribution: Shadlington commentedApplying that patch stops the warnings but then nothing happens when I click on a facet. The url is appended to but the search results are unaffected.
Comment #3
miiimoooAdded to 7.x.-1.4
Comment #4
Shadlington CreditAttribution: Shadlington commentedAs I said in #2 this only fixes the warnings.
The facets stop working though, and only append onto an ever-expanding url without ever actually filtering the results!!
Comment #5
drunken monkeyThis still happens for you? I could neither reproduce this before, nor can I reproduce it now, so probably Michael will need additional information for analyzing / fixing this. Most importantly: do all facet links stop working, or only those for taxonomy terms?
Comment #6
Shadlington CreditAttribution: Shadlington commentedIts just the taxonomy terms.
EDIT: This was a stupid post. No, really. Stupid.
Comment #7
drunken monkeyNo, I can't reproduce this. And the ID-based ones of course still work, as they aren't rewritten, yet.
Once the issue you linked is committed, this module should probably be adapted to also support those facets.
Why the patch would make this module unnecessary, I don't know, though – the URLs generated by the Facets module use GET parameters in any case, after all. And in the case of directly indexed taxonomy terms, they'll even contain the TID instead of the name, which is even worse.
Comment #8
Shadlington CreditAttribution: Shadlington commentedOh bugger - ignore #6 as its really just rubbish.
EDIT: I initially made a long-winded explanation of why I said what I said in #6 but it doesn't really matter and just confuses issues. The point is it was garbage and should be ignored. Sorry!
Back to the point now and I haven't got a clue why this isn't working then.
It only happens to Taxonomy >> Name facets - i.e. the ones that it is attempting to rewrite.
And it only happens on paths that it has been enabled for.
Trying to work out if there's anything else to it now...
Comment #9
Shadlington CreditAttribution: Shadlington commentedEDIT: I thought I'd found out what was going on but I was wrong.
Blehhh.
Comment #10
Shadlington CreditAttribution: Shadlington commentedEDIT: Wrongwrongwrong.
Comment #11
Shadlington CreditAttribution: Shadlington commentedEDIT: Blah wrong issue >_<
...This is not going well for me.
Comment #12
Shadlington CreditAttribution: Shadlington commentedJust seen your email Michael, I'll give you access to my test site and email the details.
Comment #13
miiimoooOkay one thing I notice is that we're using different versions of Search API. For instance, the version I'm using uses Fulltext or String for taxonomy term names and has no special Taxonomy term field type. I can't see your version number so here's my list:
It's all 7.x-1.0-beta7
Comment #14
Shadlington CreditAttribution: Shadlington commentedAh. I'm on the latest dev version.
Also, those special term fields are do to a patch that I forgot to rollback before giving you access - I assure you that the problem occurs even without it.
Hold on, I'll roll it back.
Comment #15
miiimoooOkay it's not the version but more about your label issue. For Pretty Paths to work you need to use the Category >> Name facet. The ID based ones don't work. Probably should document this. Your Multi and Single test are working too - maybe because I ran the re-index from the Search API menu.
Comment #16
Shadlington CreditAttribution: Shadlington commentedAwww crap. I'm gonna have to create a new index again. Hold on.
EDIT: Sorry, that was a cross-post. But that isn't right, the ID ones weren't what I was testing, they were for something else. It was the >> Name ones I have the problem with. One of them works (Tag) but the others don't.
And I'm in the process of rolling everything back to an earlier version, bear with me.
Comment #17
Shadlington CreditAttribution: Shadlington commentedHere we go. Try again.
I'm now back on the beta7 version, no patches.
You should see what I see right away - the last facet block (Tags) works but the other 3 don't.
Comment #18
miiimoooIt's the space in the vocabulary name. I hadn't tested with that.
Comment #19
Shadlington CreditAttribution: Shadlington commentedo_O
Phew.
That makes sense.
I figured there had to be something different between those 3 and the one that worked... Didn't twig that a space could be the cause.
Its a huge relief to have an answer - this was seriously bugging me!!
Thanks Michael
Comment #20
miiimooofixed in 7.x-1.6