Currently adding a flag relationship and using the "flag link" field in views will not work properly if you have not set a node type on the flag. This is because type_access_multiple is called, which creates invalid SQL.

The fix is to add a check to make sure flag types exist before building the query.

CommentFileSizeAuthor
#1 1992108-check-types.patch2.58 KBbeeradb

Comments

beeradb’s picture

Status: Active » Needs review
StatusFileSize
new2.58 KB
joachim’s picture

Status: Needs review » Needs work
+++ b/flag.inc
@@ -1350,9 +1350,8 @@ class flag_entity extends flag_flag {
-      '#description' => t('Check any bundle that this flag may be used on. You must check at least one bundle.'),
+      '#description' => t('Select the bundles that this flag may be used on. Leave blank to allow on all bundles for the entity type.'),
       '#default_value' => $this->types,

This change is already in Flag 3.x.

It does look like we need a fix to type_access_multiple() in 3.x, in flag_entity. Care to reroll for 3.x?

beeradb’s picture

Status: Needs work » Closed (works as designed)

This is my bad -- I was working in an environment which had http://drupal.org/files/flag-all-bundles-7.x-2.x-471212-13.patch applied and didn't realize it. It looks like that check is actually in the 3.x branch already. I'll update the issue at 471212 to include it in the 2.x backport.