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

yannickoo’s picture

Subscribing

rogical’s picture

Version: 6.x-2.x-dev » 7.x-2.x-dev

+1 same issue on D7 version

rogical’s picture

I just find a temp solution: set the 'NO RESULTS BEHAVIOR' in the view.

quicksketch’s picture

We 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.

joachim’s picture

Version: 7.x-2.x-dev » 7.x-3.x-dev
steveoliver’s picture

I 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.

linus79’s picture

You can use Global:PHP

<?php print flag_create_link('bookmarks', $node->nid); ?>

turbogeek’s picture

Issue summary: View changes

Implementing hook_flag_access_multiple() worked. Thanks steveoliver!

ivnish’s picture

Status: Active » Closed (outdated)

Closed as outdated because Drupal 7 is EOL