-    if ((isset($recipient->friend_notification) && $recipient->friend_notification !== -1) || !isset($recipient->friend_notification)) {
+    if ((isset($recipient->friend_notification) && $recipient->friend_notification != -1) || !isset($recipient->friend_notification)) {

We have to use "not equal" (!=) operator instead of "not identical" (!==) , because user settings stored in the database as strings, not numbers.

CommentFileSizeAuthor
flag_friend.module.patch761 bytesquotesbro

Comments

quotesbro’s picture

Otherwise we should enclose -1 with double quotes.

quotesbro’s picture

Priority: Normal » Major
Status: Active » Needs review
mikl’s picture

Status: Needs review » Reviewed & tested by the community

Looks good, should be merged.

sirkitree’s picture

Status: Reviewed & tested by the community » Fixed

I opted for the quotes around -1 instead and kept the "not identical" (!==) as it's more accurate and keeps the reader in mind that this is stored as a string.

Commit: http://drupalcode.org/project/flag_friend.git/commitdiff/01a0f0c0c37efb9...

Thanks!

quotesbro’s picture

Thank you. Could you commit it to 6.x-1.x-dev as well?

sirkitree’s picture

Status: Fixed » Closed (fixed)

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