Hello,
I am trying to develop a functionnality that allows administrator to flag/unflag a node to all users at once. The purpose is to give the possibility to admin to push screen notifcations to users. Once read, user can remove them from their notification list.
If this is successful, I'll publish an add-on module.
I've indentifed that function _flag($content_id, $uid, $sid) is where the flag is set.
I've coded a similar function to populate the flag_content table for all users.
However, when a user unflags one of this node, it receives a PDO integrity error on flag_content table.
My question is the following : when a user flags a node, what functions are called and in which order. I'll then replicate that process with custom functions.
Many thanks in advance for your help.
Laurent
Comments
Comment #1
joachim commented_flag() is a private method -- its docs tell you that. Don't use it.
You should be using flag() (note without the underscore) as that fires the relevant hooks and performs housekeeping.
Comment #2
agence web coheractio commentedThanks. I'll try this then.
Laurent