In case a user does not have rights to access an entity, facetapi returns the entity_id instead of the name in the #markup, but it is not excluded from display and looks kind of ugly.

This plugin allows them to be excluded from display.

Hope this can be added to the next release.

This plugin was developed for the Devtrac project and sponsored by Unicef Uganda.

Comments

ygerasimov’s picture

Status: Needs review » Needs work

Thank you for the patch. I am not quite sure how to build the facets where each item is an entity? I guess it should be something like entity reference field.

Could you please provide step by step instructions for this?

Jan van Diepen’s picture

The use of the name "entity" put you a little bit of track, I guess.

The particular problem we had actually involved taxonomy terms. We used taxonomy_access to regulate access to the different taxonomy terms. Now, when we created a facet on the terms of a particular vocabulary, all terms used in the result set where showing as items in the facet. The ones we had access to showed as term name and the ones we did not have access to showed as term id. The desired behavior would be to only show the names of the terms we had access to.

The plugin we wrote does exactly that. It filters out the inaccessible items on the facet.

Hope this clarifies it a bit.