🇨🇦Canada @Menthos

Account created on 27 May 2015, over 9 years ago
#

Recent comments

🇨🇦Canada Menthos

@BenStallings Thanks i will definitely go and have a look. Currently for me switching to Facets 2 fixed the issue however.

🇨🇦Canada Menthos

@BenStallings On my end, I ended up using Facets 2 and facets blocks and was able to get it to work properly. Are you getting basically the same error?

🇨🇦Canada Menthos

I just tested it again on a fresh drupal instance, with only the module listed installed and still the same problem. I haven't installed any patch as its kind of hard to follow which are required currently to be honest.

🇨🇦Canada Menthos

Can you try with Facet 3 to see if works? I see no error on my end, just the facet not being applied.

🇨🇦Canada Menthos

So i found the solr document data in the $view array, now I am trying to figure out how to alter my view. When I alter the view, its not getting updated.

I can get all the values of the source solr document, with all the fields.
I can manipulate the values in the $view object in _hook_views_post_execute in $view->result[0]->_item
The changes are not reflected in the actual data displayed.

Anyone has any idea if there is a hook I can work with from that? Maybe the hook i am using is too late, i.e. the views fields are already populated from the item element, so even if i make changes there, they are not reflected?
Code snippet:

function osgg_search_api_extras_views_post_execute($view){

  $view_fields_values=&$view->result[0];
  $view_fields_definition=$view->result[0]->_item->getFields();
  $solr_original_document=$view->result[0]->_item->getOriginalObject();
  $original_fields=$solr_original_document->getValue()->getFields();

 foreach($view_fields_definition as $key=>$value){

  if($key=="i18n_citation_en"){
    //replace with french value
    $field=$view->result[0]->_item->getField($key);
    $field->setValues($original_fields["i18n_citation_fr"]->getValues());
  }
 }

}
Production build 0.71.5 2024