Closed (outdated)
Project:
Flag
Version:
7.x-3.x-dev
Component:
Flag core
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
18 Jul 2012 at 03:05 UTC
Updated:
19 Aug 2025 at 12:19 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
jweowu commentedI notice that
flag_get_counts()bypassesflag_node::get_translation_id()This just tripped me up, and may also be responsible for this attendance count issue?
edit: or at the very least, it seems that
flag_node::get_count()should be implemented?Comment #2
jweowu commentedThis patch implements
flag_node::get_count()I suspect this will fix the original issue, but I've not tested that.
Assuming it does, I'm still unsure whether this should be considered sufficient for a solution, or if
flag_get_counts()needs to become translation-aware as well?Comment #3
joachim commentedflag_get_counts() has to remain generic.
This patch looks fine to me but I'd appreciate testing from someone who has a multi-language site.
Comment #4
joachim commentedBetter title.
Comment #4.0
joachim commentedSet strong for the bug.
Comment #5
edxxu commentedI got same issuse with 7.x-3.3. IF i choose 'Flag translations of content as a group' option in flag edit form, the flag count will be always show the count of source node.
Here is the patch for 7.x-3.3 which is tested on my multi-language site, please review.
Comment #6
jweowu commentedI won't change the status as I'm not running 7.x-3.x, but this looks functionally identical to my patch in #2 (defining
flag_node::get_count()with an identical definition), so it gets my vote.Comment #7
joachim commentedHmm so hang on, let me see if I understand.
You have a node that is in English, and also a translation of that node in Japanese. Someone flags the English node, and its count is now 1.
You expect the Japanese node to have a count of 1 too?
What if you wanted to specifically flag translations? Say you're a site translator, and you have a flag called 'Needs review from a translator'?
Also, do you expect just the count to go up, or do you want the flagging to somehow carry over too? If I flag the English one with a non-global flag, and then look at the Japanese one, should I see that as being something I've flagged or not?
Comment #8
jweowu commentedWell we're talking about the effect of the "Flag translations as a group" option.
If that's enabled, then a flagging should affect all nodes in the translation set, and therefore the count should be shared across all nodes in the translation set.
IIRC the former happens, and this patch is to fix the latter.
Comment #9
skyredwang@joachim what #5 patch does is to get the number of flags of the translation of the node, if Translation Helpers Module exists, by overriding the
get_count()in flag_node.There exists similar codes doing the translation for the action
flag, please see http://drupalcode.org/project/flag.git/blob/HEAD:/includes/flag/flag_nod...Therefore, #5 patch looks solid for me.
Comment #10
gagarine commentedI'm using patch #5 without problems.
Comment #11
joachim commentedWe have this option in the UI:
but AFAICT, the functionality in the patch is not paying heed to it.
Comment #12
jweowu commentedBut that option is precisely what the
get_translation_id()method deals with, right? (Or is this some additional option? I don't have my editor available right now, so I can't easily search the code to check; apologies if I'm confusing two different things.)Comment #13
joachim commentedAh, I get it now. Thanks for persisting with my lack of understanding!
This should have tests though, as it's functionality that's not that commonly used, and also quite complex to reproduce. I'm working on them :)
Comment #14
joachim commentedComment #17
joachim commentedOops.
Turns out though that we don't need translation_helpers for this test, as we're not deleting translations.
Comment #19
ivnishDrupal 7 is EOL. Issue will be closed, but patches are still here