There are things in our anon flagging support that look suspicious. Here's a quick list of things that require further investigation.
There are things in our anon flagging support that look suspicious. Here's a quick list of things that require further investigation.
Comments
Comment #1
mooffie commented$flag->theme():
- The variable $js_action isn't used.- It seems we don't force the output to be the "Flag this!" link.See #996710: Anon flagging: Output of "flag this!" links only isn't enforcedComment #2
mooffie commented$flag->_unflag():
- "$_COOKIE['flag']" is a typo.- What's the purpose of these two lines? It should be documented (e.g., why it's not in _unflag_anonymous() instead).See #1000128: Anon flagging: delete dead code
Comment #3
mooffie commented$this->_flag_anonymous() etc.:
I guess the lines "$_COOKIE['flags'] = $cookie_flags" and "$_COOKIE[$cookie_key] = 1" have some purpose. It should be documented.This isn't important, now that our code isn't messy.
Comment #4
mooffie commentedD7:
We use CACHE_DISABLED which doesn't seem to exist. (Maybe some of the other cache-related variables we use have changed in D7 as well.)See #1001076: Anon flagging: CACHE_DISABLED gone in D7
Comment #5
mooffie commentedViews:
We should use ***FLAG_SID*** instead of flag_get_sid() to make the query cacheable.See #1003232: Use query substitution for the SID
Comment #6
mooffie commentedD7: $flag->theme():
Why does the second drupal_add_js() call uses 'scope' but the first doesn't?See #1005040: Fix parameters to drupal_add_js()
Comment #7
mooffie commentedWe have:
Should it be "flag_get_sid(0)" or "flag_get_sid()"?
(Yeah, it seems "flag_get_sid(0)" is correct (although I remember the author of Session API saying the SID is now preserved between logins). Whatever, it won't hurt to double check this part. MySQL does emit warning.)
Comment #8
mooffie commentedWe say, "Warning: Adding this relationship for any flag that contains anonymous flagging access will disable page caching for anonymous users when this view is executed. [...]"But this is only true when [...]See #1006526: Anon flagging: clarify Views warning
Comment #9
joachim commented> Should it be "flag_get_sid(0)" or "flag_get_sid()"?
There's an issue for that, which is horrendously convoluted and where everyone disagrees :(
Closing this as it seems like a meta-issue and everything else has been crossed off.