I have this notice with a taxonomy terms reference facet, once I click one item of the facet:
Notice : Undefined offset in Drupal\facets\Plugin\facets\processor\TranslateEntityProcessor->build() line 120

Patch will follow.

Comments

SylvainM created an issue. See original summary.

sylvainm’s picture

Status: Active » Needs review
StatusFileSize
new652 bytes

With this patch, I solve the problem

borisson_’s picture

Status: Needs review » Reviewed & tested by the community
borisson_’s picture

Status: Reviewed & tested by the community » Postponed (maintainer needs more info)

We would need to actually see what's going wrong here, can you add steps to reproduce?

sylvainm’s picture

Status: Postponed (maintainer needs more info) » Needs review

STR:

  • Create a facet on a taxonomy reference field, with following processors:
    • Hide non narrowing results
    • Translate entity label
    • Hide facet when facet source is not rendered
  • Index some content with a term of a taxonomy
  • On search page, click on item link
  • On page (search?f[0]=field_taxo%3A56), you have the notice and the item in facet has the id as anchor of the link, instead of the name.

The first foreach loop (l.85) does not use indexes of $results to store $ids but incremental, starting from 0; but the second one (l.119) uses it: $ids[$i], so if we want that $ids[$i] to be set, we have to uses $results when filling $ids.
When you are on the page ?f[0]=field_taxo%3A56, the $i in second foreach does not always start with 0 (in my case, it is 5 the first key).

Is it more clear for you?

borisson_’s picture

Status: Needs review » Fixed

Committed, thanks!

  • borisson_ committed 4e5f750 on 8.x-1.x authored by SylvainM
    Issue #2789869 by SylvainM: Item disappears from facet once clicked
    

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.