When you allow anonymous users to flag the javascript function Drupal.flagAnonymousLinkTemplates looks for templates in the javascript object Drupal.settings.flag.templates using the flag's css name (when all underscores have been replaced by hypens). However the theme function in flag.inc uses the flag's name without replacing the underscores. Therefore this doesn't work for flags with names like "my_site".

I attach a patch which adds a new method to the flag object get_css_name and uses this method in the places where it should (i.e the preprocess function and in the cookie handling functions in flag.inc)

CommentFileSizeAuthor
#1 anon-underscore.diff2.97 KBmooffie
flag_css_name.patch4.48 KBalexpott

Comments

mooffie’s picture

Assigned: alexpott » Unassigned
StatusFileSize
new2.97 KB

I think it's inelegant to use the CSS name, instead of the pure name, in various places. We'll eventually need a map to remember which is which. It's more logical to use the pure name.

Here's a patch.

mooffie’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.