Closed (won't fix)
Project:
Flag
Version:
8.x-4.x-dev
Component:
Flag core
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
6 Nov 2017 at 16:03 UTC
Updated:
6 Nov 2017 at 23:09 UTC
Jump to comment: Most recent
Comments
Comment #2
joachim commentedIn the summary at #2409859: [Policy, No Patch] Where did the Flag 7.x hooks go in 8.x? is suggests this should be doable with a custom flag type plugin.
What's your use case?
Comment #3
daggerhart commentedI have some Flagging/Unflagging event subscribers that need to respond to some-but-not-all flaggings. So I thought it would be great if I could provide a checkbox on the Edit Flag page to easily inform the event whether or not the flag should be responded to.
With the included patch applied to flag, I am doing this is my custom module to add my new setting to the flag form:
Then in my event subscriber, I'm looking for that setting to determine if the event should handle the given flag:
This is much more ideal than checking the flag names within the event subscriber.
Comment #4
joachim commentedOk so you're not supposed to add extra stuff into a plugin's configuration array, or a config entity's properties for that matter:
You should be using set/getThirdPartySettings() and adding a submit handler in your form alteration to save it.
You don't need this. Admittedly, then you don't have the default value of your setting defined anywhere, but that is a flaw in core, not here.