Views ver. 6.x-2.12
Using a table view to display a set of flags that one role is only allowed to flag the content displayed.
Flagging the content works correctly and displays the "Unflag not Allowed" text. Subsequent loads of the view display links for the unflagged content and empty cells where the "Unflag not Allowed" text should appear.
Comments
Comment #1
yannickooSubscribing
Comment #2
rogical commented+1 same issue on D7 version
Comment #3
rogical commentedI just find a temp solution: set the 'NO RESULTS BEHAVIOR' in the view.
Comment #4
quicksketchWe could probably avoid this problem by using $flag->applies_to_content_id() instead of flag_access_multiple(). Right now each "Flag" link requires a node load anyway (per #404150: Improve performance of the "Ops" field in Views), so using applies_to_content_id() to determine if the link should be displayed would be more accurate than using an access check.
For now an easy work-around is to use the Views ability to customize the empty text when a field has no value.
Comment #5
joachim commentedComment #6
steveoliver commentedI just opened an issue (#1913240: Hide flag link from views rows when hook_flag_access returns false), maybe it's the inverse of the problem here.
Comment #7
linus79 commentedYou can use Global:PHP
<?php print flag_create_link('bookmarks', $node->nid); ?>Comment #8
turbogeek commentedImplementing hook_flag_access_multiple() worked. Thanks steveoliver!
Comment #9
ivnishClosed as outdated because Drupal 7 is EOL