Brief rundown of my setup:

Content type 'Event' has two PBF fields on it:

  • First pbf field references a taxonomy term, which then grants update & delete to an editor user.
  • Second pbf field grants 'view' access to anon & authenticated roles.

When printing the referenced term name in a view, the term name itself is not printed. If you switch to the raw output of target_id (using the REST views displays 'display as raw'), that prints the target_id as expected. It seems to be the conversion to the label of the taxonomy term that the field points to that's the issue.

This happens in all view displays: I've tested REST export, page and block.

I've traced the code in PBF back through pbf_node_grants() - which seems to be returning the correct result (e.g. user can VIEW the node) based on my particular setup, when checked for both anonymous and editor users.

As an admin user loading the same views page, I hit both checkAccess() and viewElements() methods inside the PbfFieldFormatter class. As an anon user, I do not hit these methods at all.

I believe it may be related to this: https://www.drupal.org/project/drupal/issues/2692091

Does anyone have any idea what may be causing this - I'm surprised no one else has found this?

Comments

MattHalo created an issue. See original summary.

flocondetoile’s picture

Hi,

Have you reproduced this bug on a vanilla install, without others modules ?

pawel_r’s picture

Hello, please see https://www.drupal.org/project/drupal/issues/3114365 especially comment #8. It suggests to use contrib module called Taxonomy access fix untill proper fix is not implemented.