Problem/Motivation
I've got a taxonomy vocabulary A with a field_def referencing a term from another vocabulary B which has a field_abc referencing paragraphs.
In my taxonomy term template for vocabulary A I want to display the value of field_abc from the referenced taxonomy term:
{{ drupal_field('field_abc', 'taxonomy_term', term.field_def.value.0.target_id, view_mode, 'en', FALSE) }}
When the last argument is set to FALSE, it is supposed to disable the access check.
If I unpublish the term from vocabulary B which is referenced in my term from vocabulary A, anonymous users don't see the content of this field even if we said we didn't wanted an access check.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | 3399028-2.patch | 835 bytes | pradhumanjain2311 |
Issue fork twig_tweak-3399028
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
pradhumanjain2311 commentedComment #3
macsim commentedComment #4
macsim commented#2 is adding more access check. It's not the problem.
The problem is : we should have no access check at all when
$check_accessis set toFALSEComment #7
prashant.cAdding
$check_accessto the condition. Please review.Thanks!
Comment #8
macsim commented#7 won't fix the problem
There's no problem when
$check_accessisTRUE(that's what #7 is checking)The problem is that when
$check_accessisFALSEthe following code returns nothing when it should return a renderable array:Comment #9
chi commentedThe access check parameter only applies to the entity being viewed. I this case it's a term from vocabulary B. It does not affect checking access for child entities (paragraphs). If it's not the case, please provide exact steps to reproduce. Preferably without involving contributed modules.
Comment #10
macsim commentedThen it works as designed
Perhaps the doc should be more explicit about that point
Swapped category from "Bug report" to "Task" + component from "Code" to "Documentation"
Feel free to close the issue if it sounds explicit enough for you.
Comment #11
anybodyPlease check if this is still relevant and use 4.x as target branch for Merge-Requests (MR) as that's the new development branch. Thanks!
Comment #12
macsim commented