Closed (fixed)
Project:
Flag
Version:
7.x-3.9
Component:
Flag core
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
29 Nov 2018 at 16:39 UTC
Updated:
31 Dec 2018 at 12:39 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
joachim commentedAt the moment, the only way is to hack it in the database by hand.
Comment #3
delvalle commentedThanks joachim. Is it a "risky" hack or there should be no problem with it?
Also, in the table "flag_counts" I see some nodes with the same "entity_id" but different "fid" (1, 2 or 3). I have no idea what that means here.
In case someone else want to do this hack, the code I used is the following (not sure if it's the best option, but it seems to work):
UPDATE flag_counts SET count='24' WHERE entity_id='40';Comment #4
joachim commented> Also, in the table "flag_counts" I see some nodes with the same "entity_id" but different "fid" (1, 2 or 3). I have no idea what that means here.
The fid is the flag ID. The {flag_counts} table holds the count for each entity, per flag.
Comment #5
tim berners lee commentedI think this patch help you.
Comment #6
delvalle commentedThanks a lot Andrew, it works and it's more convenient than editing via Mysql. :)
But it's not ideal, because I think it changes the flag count for all the flags that are used in that entity (the Mysql code I provided has that same problem). It would be better if we could indicate also the Flag ID that we want to change.
Comment #7
tim berners lee commentedI added new features.
Comment #8
delvalle commentedThanks, but those new features are not useful for my needs.
Let me give an example: I want to change the flag count to 24 for the flag ID 1 in the entity ID 40 (leave the other flags in that entity unchanged).
I think that's not possible in the latest patch (you can select the flag ID or the entity ID, but not both at the same time).
If this is difficult to implement in a patch, I will probably just do it with Mysql.
Comment #9
tim berners lee commentedI hope this time I understand you correctly
Comment #10
delvalle commentedI see changes in the code, but the configuration page looks the same to me as with the previous patch (3017024-7). I've cleared caches just in case.
I'm still unable to enter the flag ID and entity ID I want to change at the same time (it lets me enter only one of them).
Maybe it's easier to explain if I put the Mysql code that does what I want (the key here is the AND):
UPDATE flag_counts SET count='24' WHERE entity_id='40' AND fid='1';Comment #11
tim berners lee commentedTry to reset unindexed changes:
And then, apply patch again.
Comment #12
delvalle commentedI don't use Git, I'm applying the patch manually
Comment #13
tim berners lee commentedSo, you can try to replace the files in your folder from this zip, that contain changes provided by the last patch.(3017024-9-change_flag_count.patch)
Comment #14
delvalle commentedAfter uploading your files it works! Not sure what I did wrong applying the latest patch. :S
Thanks a lot Andrew!