When trying to "Reset flags", after the confirmation step, I'm seeing the following PHP Fatal Error in version 6.x-2.0-rc1:

"Fatal error: Call to undefined function flag_reset_flag() in ~/sites/all/modules/flag_abuse/flag_abuse.module on line 70"

The function flag_reset_flag doesn't exist anywhere in the flag_abuse module's code as far as I can see, and a quick grep isn't showing the function anywhere else in my install, including anywhere in the Flag 6.x-1.3 module. Do I have a version incompatibility, or is this just a mistake I could patch?

Many thanks in advance,

Alex

CommentFileSizeAuthor
#6 flag_abuse_reset_flags.patch693 bytesClaireC

Comments

amandine_m’s picture

You have to install Flag 6.x-2 module instead of 6.x-1.3

Siriki’s picture

Status: Closed (works as designed) » Active

i got a same error.now i install the 6.x-2.

Hi amandine_hyptique ,
i have one doubt. when i install the flag module, in that time no pb.But i enable the flag_note module in that time i got an error.
Fatal_error: unsupported operand types in flag module in line 1603.
please tel me solution.
Thanks

amandine_m’s picture

Sorry, I don't use flag note module, so unfortunatly I can't help you.
Just be sure to have the good version (6.2-x releases are only compatible with flag module version 2).
The problem is the versions 6.2 are still in dev, so maybe there are some bugs.

Siriki’s picture

ok.Thanks for quick replay.

Ainur’s picture

flag_reset_flag() function is called but it's missing somehow.

Try adding this

/**
 * Reset flag
 */
function flag_reset_flag($flag, $content_id) {
	// remove all flag on this content
	$query = db_query("SELECT uid FROM {flag_content} WHERE fid = %d", $flag->fid);
	while ($result = db_fetch_object($query)) {
		// Supposed to pass in a full $account here, let's see if we can fake it
		$flag->flag('unflag', $content_id, $result, TRUE);
	}
}

to flag_abuse.module.
I'll appreciate if someone will commit a patch for this .

ClaireC’s picture

Status: Active » Needs review
StatusFileSize
new693 bytes

And here's the patch. Thank you Ainur

sirkitree’s picture

Status: Needs review » Postponed (maintainer needs more info)

The reset function is in Flag-2.x. You should not need this if you are using Flag Abuse 2 with Flag 2, as listed in the Dependencies on the project page of this module.

Ainur’s picture

sirkitree my bad.

sirkitree’s picture

Status: Postponed (maintainer needs more info) » Closed (works as designed)

Status: Active » Closed (works as designed)