Search results only displaying the default view mode, even when I select a different view mode in apache solr settings. Anyone else having this issue?

Comments

bogdan1988’s picture

Hi rp121, could you please provide apachesolr module version and settings of search page?
Thank you

robdubparker’s picture

Sure thing.

  • Using Apache Solr Search version 7.x-1.7
  • On the settings page under Apachesolr Display Settings I have the view mode set to "search result highlighting input" with "store node objects" selected.

I checked the function apachesolr_display_process_results($results) to make sure it was pulling the correct view mode, and it looked correct.

Let me know if you need any other info.

bogdan1988’s picture

Hi sorry, for late response and thank you for notifying me about this bug. Soon I will deploy fix. Thing was in this function

function apachesolr_display_get_entity_info($type) {
  $entity_info = entity_get_info($type);
  if (!empty($entity_info['view modes']) && is_array($entity_info['view modes'])) {
    $options = array();
    foreach ($entity_info['view modes'] as $key => $mode) {
      $options[$key] = $mode['label'];
    }

    return $options;
  }
}

Previously I used replaced label instead of display machine name.

bogdan1988’s picture

bogdan1988’s picture

Status: Active » Fixed

Please feel free to reopen issue if needed.
Thank you.

bogdan1988’s picture

Status: Fixed » Closed (fixed)