Since the machine name for the "friend" flag is enabled, it can be changed. When that happens, the flag is cloned, and a second "friend" flag is automatically created.

I think it would be best to just disable the machine name field so this doesn't happen.

Comments

sirkitree’s picture

You're probably right, and we can do this for now, but soonish, I'd like to actually make it capable of working with any flag chosen, kinda like what's going on in the 7.x-2.x branch of Flag Abuse. We get a stable release on Flag Friend 7.x-1.0 and then we can start that initiative. But for now, making this unchangeable is a good idea.

shawn dearmond’s picture

Status: Active » Needs review
StatusFileSize
new548 bytes

Here's a patch

sirkitree’s picture

Status: Needs review » Needs work
+++ b/flag_friend.module
@@ -117,6 +117,16 @@ function flag_friend_views_api() {
+function flag_friend_form_alter(&$form, &$form_state, $form_id) {

Let's use a hook_form_FORM_ID_alter() here instead

+++ b/flag_friend.module
@@ -117,6 +117,16 @@ function flag_friend_views_api() {
+  if ($form_id == 'flag_form' && $form['#flag']->name == 'friend') {

then we can remove the first part of this if statement to check the $form_id

Powered by Dreditor.

shawn dearmond’s picture

Status: Needs work » Needs review
StatusFileSize
new531 bytes

Good call. Here's an updated patch.

sirkitree’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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