I've noticed something strange recently that is probably related to one of our recent commits. I've got a relationship type called "friend" that requires approval. But for some users (but not all users), it appears that approval is not being required. I thought this could be a bug with the auto-approval option, but even with that setting unchecked in the module settings page, the bug is still occurring.

The really strange thing is that this is happening only for some users. Any user who requests a friend relationship with that user will have it immediately approved.

Any ideas as to what could be causing this?

--Ben

CommentFileSizeAuthor
#3 fix_wrong_autoapprove.patch1.25 KBberdir

Comments

berdir’s picture

Confirmed, notices the same thing, will investigate...

BenK’s picture

Any ideas as to what commit might be the cause?

berdir’s picture

Status: Active » Needs review
StatusFileSize
new1.25 KB

Got it.

The check was using isset() instead of !empty(). The difference is that isset() is TRUE if the value is actually FALSE but does exist, while !empty() returns FALSE for FALSE, 0, empty strings and so on.

The reason was a incorrect php notice fix, happened probably during the initial port.

This only happens when you've saved the account settings page of a user, then it explicitly stores FALSE.

Note that storing these settings in $user->data is a bad idea anyway, created a follow-up here: #1115514: Use custom tables to store UR user settings

BenK’s picture

Status: Needs review » Reviewed & tested by the community

Awesome! I tested the patch and it fixed the problem. :-) This is RTBC.

--Ben

berdir’s picture

Status: Reviewed & tested by the community » Fixed

Commited!

Status: Fixed » Closed (fixed)

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