Active
Project:
Flag Note
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
21 Jul 2009 at 11:24 UTC
Updated:
20 Feb 2010 at 13:47 UTC
Hi,
I like the work that is being done here. But it strikes me that Flag Note does two totally different things.
On the one hand, it introduces Flag notes. hook_flag_link_types seems like a good place to do this.
On the other hand, it keeps a flagging history. The latter functionality should ideally be implemented in a more generalistic way, no? It has no relation whatsoever with making notes when flagging. People should be able to keep a flagging history for every flag.
Should we split Flag Note in seperate modules? I'm willing to help on this.
Comments
Comment #1
gunzip commentedwell, you might be right. but i still cannot image a real situation in which you need to have a flag history without any information tied to the flagging/unflagging operation. may you please make an example ?
Comment #2
TUc commentedWell, I like the broad, general approach of Flag. I use it from time to time as a way of subscribing to events. I want to know when people subscribe, but also if and when they unsubcribe. I want to keep records of past "subscriptions".
TUc
Comment #3
gunzip commentedgood point. it's possible to separate history and 'notes' (as additional information).
we have to use a table (a copy of the flag_content one) and a place to store optional additional info
(if you just want to keep an history) like cck/node tables: a rewrite of flag note to use cck nodes instead of just plain text
is planned. see #505230: some thoughts about a flag history and some fixes/improvements.
if you want to help you're welcome.
do you think there's the need for a split ?
Comment #4
TUc commentedI agree that we should keep as close as possible to the Drupal-way of doing things. A rewrite of flag notes to use cck nodes is in that respect a good evolution, I guess.
IMO, a split is the most coherent way forward, since the functionality is essentially non-related. Modules are building blocks. We could make a module Flag History and a module Flag Note.
Another solution, but one that I regard as suboptimal, is transforming Flag Note to an extension project for flag. This module could gather all sort of functionality, preferably in different modules. But in that case, Flag Note should be renamed to something else.
What do you think?
Comment #5
gunzip commentedi think that renaming the project to flag_history adding a functionality "add history information" (cck nodes through nodereference or userreference) would be the simplest (faster) solution. actually if you activate notes then you can choose to keep a flag history but probably the "you can activate notes regarding or not keeping of a flag history" paradigm is more correct.
anyway i understand the "building blocks" view so if you want to write a flag_history module you're welcome,
then i will refactor flag_note considering this new module, let me know.
Comment #6
TUc commentedCan you elaborate on your ideas? I think renaming the module to flag_history doesn't take us any further. It will still do two unrelated tasks, no? It only gets renamed.
I'm about to work on the history part of this module, so we can see later how we will split things up. We can still just put the two modules in the same project if you want. We can discuss the integration of the note-functionality with CCK also.
cheers,
TUc
Comment #7
gunzip commentedi think i'll wait untill you finish flag_history as a separate project,
then i'll integrate a new major release of flag_note with it (if you agree).
cheers~
Comment #8
hefox commentedThe discussion in #585976: view relationships don't filter on flag type/id and user (current/any) has gotten me thinking about flag_history (ya know when your mind wonders and end up back to a random subject again and again?). Again I'm mainly motived by the absolute belief that flag_note should safely be able to join with flag_content.
My current thoughts/suggestions would be that fcid (flag content id) is the flag version ID. The reasoning behind this is that fcid can change, to my knowledge, when an item is unflagged then reflagged. So it's changing id in some respect to the same information (content_type,content_id,fid,uid make a unique item).
So for a flag_history table
fcid, flag content id, serving as a vid
fhid, flag history id, serving as nid sorta. For every instance of content_type, content_id, fid, uid the same fhid is used. Or actually, don't even need this. Content_type,content_id,fid,uid is already serving as that.
Could also store an additional field argument that could describing what the change is ie "flag" "note change" etc.
So as far as views goes, should thus be able to make a connection to flag_history jut like flag_content and get the flagging history.
As far as flag_note goes it simplfies the schema
fcid
note
Since fcid is the unique for each note this way, it can directly connect to the flag_history and the flag_content tables without worries.
hook_flag is changing so could even add a 'note' as an action (search flag issues for that, too tired!)
Then flag_note changes by triggering an update on the fcid (either change the id or delete and re-insert. don't want to flag/unflag due to the hook's being called, just db change). Also, flag_note would not have to depend on flag_history.
Massive re-write, but not too much?
Anyhow, just suggestions.
Comment #9
hefox commentedSome new thoughts. Sorry, been walking too much and my mind decided to think of this :/!
One of the issues with just directly copying the flag table and keeping track of that is that there are other modules altering, connecting to flag_content, for example flag_weight (well, only one I can think of atm actually) (thus also why my fcid as fvid wouldn't work).
Flag weight operates by adding the variable to the flag_content table. It does that via the install function.
To keep appropriate track of the history of flag table, including things like flag_note and flag_weight, perhaps it'd be a good idea to try capturing the changes to flag_content.
Unfortuanlly there appears to be no hook called when a module is enabled, so can't react to that.
But if could get compatible modules to notify flag_history of new fields that they want flag_history to keep track of..
Then my newly suggested workflow ... (XD)...
(Altering tables is always wearisome in drupal, but it may work in this case?)
flag_history modifies flag_content with one field, fvid, flag verison id.
flag_history contains some sort of action to mark what has happened-flag, unflag, note changed, etc.
flag_note modifies flag_content with flag_note field.
flag_note notifies flag_history to add the flag_note field to flag_history.
on changes, ie. flag_note note changes, flag, maybe unflag,
a new entry into flag_history is made with all the details of the event.
when relavent, flag_content is updated with new fvid. (and any other relevant fields updated).
Also, nice to keep track of view's knowledge of flag_content. (For example, could directly the gather hook, hooks_views_data to figure out what has been emassed for flag_content. Or use the alter; I believe there is an alter). ?
shrug.
Comment #10
gunzip commentedfirst thank you again for your suggestions. i've tried unsuccessfully to concact TUc for any progress about flag_history.
it seems that there's a lot of work to do (and plan). unfortutaley i'm busy till the end of the month (october).
if you would like to join the project i can give you cvs access (or just, well, wait =)
Comment #11
hefox commentedI still need to apply for a cvs account, but perhaps by then I will; I'd like to help.
Comment #12
TUc commentedHi Gunzip,
I'm still around. :)
But right now very busy on a project. As ever.
I am *somewhat* following the discussions on flag_note and related projects.
Comment #13
crea commentedSubscribing