Closed bondjimbond closed 4 years ago
I'm probably not doing something right. Here's my facet cofig:
and here's my facet page:
The values are not being replaced. Any suggestions?
Do you have the latest commit to Islandora Solr?
Yes, I pulled in the most recent updates yesterday.
I didn't test exactly as you describe, I created a facet browse page. But, that shouldn't matter, AFAIK, facets in search results are the same as facets in a facet browse page. Do you think that matters?
No idea... worth testing it the way I suggested, though, and see if that makes a difference.
I will. Does using a facet page work for you?
Hmm, looks like no - only the facets sidebar. I never tried this with facet pages... they must work differently.
I wonder if somehow the hook doesn't fire on facet pages?
I'm not sure, but if hook_islandora_solr_facet_bucket_classes_alter()
is only be fired in includes/blocks.inc
, that would explain my test results:
vagrant@islandora:/var/www/drupal/sites/all/modules/islandora_solr_search$ grep -r drupal_alter *
includes/blocks.inc: drupal_alter($hooks, $attributes, $_islandora_solr_queryclass);
includes/query_processor.inc: drupal_alter('islandora_solr_query', $this);
includes/query_processor.inc: drupal_alter($hook_list, $object_results[$object_index], $this);
includes/query_processor.inc: drupal_alter('islandora_solr_results', $object_results, $this);
includes/results.inc: drupal_alter($hooks, $attributes, $islandora_solr_query);
includes/results.inc: drupal_alter($hooks, $attributes, $islandora_solr_query);
includes/results.inc: drupal_alter('islandora_breadcrumbs', $breadcrumb, $context);
includes/results.inc: drupal_alter($hooks, $attributes, $islandora_solr_query);
islandora_solr_config/includes/rss_results.inc: drupal_alter('islandora_solr_search_rss_item', $item, $doc);
islandora_solr_config/includes/rss_results.inc: drupal_alter('islandora_solr_config_rss_item_post_render', $rendered_item, $doc);
islandora_solr_config/includes/rss_results.inc: drupal_alter('islandora_solr_config_rss_root_element_attributes', $rss_attributes, $channel, $items);
But, I can't find the menu item for facet pages (/browse/xxxx
) so I don't know where else to look.
How does one create a facet block? All I found in the documentation wiki was "This module provides a block named "Islandora Solr facet pages" that can be configured in Block settings (Administration » Structure » Blocks). It contains a list of links to all configured facet pages." When I enable a "Islandora Solr facet pages' block", I don't see a list of facet pages:
How does one create a facet block? All I found in the documentation wiki was "This module provides a block named "Islandora Solr facet pages" that can be configured in Block settings (Administration » Structure » Blocks). It contains a list of links to all configured facet pages." When I enable a "Islandora Solr facet pages' block", I don't see a list of facet pages
Enable the block, stick it in your sidebar, and you'll get links to any facet pages that exist.
I'm not sure, but if
hook_islandora_solr_facet_bucket_classes_alter()
is only be fired in includes/blocks.inc, that would explain my test results
I can note in the admin form that this will only work in search facets and not facet pages, if that helps?
@mjordan Any further thoughts on this? Do you want some text in the admin form about facet pages? Is it otherwise good to go?
@bondjimbond yes, some text that explains that would be useful. Then I'll merge.
Also, would you mind adding a bullet point about this new feature in the README?
@mjordan Updated. Let me know if the wording still needs adjustment.
Looks good. Thanks!
Noted an issue here. Every time there's a search, this appears in the logs:
Notice: Undefined offset: 1 in islandora_metadata_extras_facet_convert() (line 68 of /var/www/html/drupal7/sites/all/modules/islandora_metadata_extras/includes/utilities.inc).
This happens only in my production site; not in Vagrant.
Is it possible there might be an out of date module creating this conflict? Do you get similar results?
Handles issue #20
Now that https://github.com/Islandora/islandora_solr_search/pull/370 has been merged, this will work.
What does this Pull Request do?
Using the new features in hook_islandora_solr_facet_bucket_classes_alter() to modify the facet label, allows you to define a string from a search facet and replace it with an alternative.
How should this be tested?
Interested parties
@mjordan