All the cool modules provide alter hooks for the default definitions, flag should totally get on the bandwagon.

(I can provide more reasons if necessary).

Files: 
CommentFileSizeAuthor
#3 flag-default-flags-alter-hook-2027091-03.patch2.85 KBjhedstrom
PASSED: [[SimpleTest]]: [MySQL] 266 pass(es).
[ View ]
#1 2027091-flag_hook_flag_default_flags_alter-1.patch2.59 KBhefox
PASSED: [[SimpleTest]]: [MySQL] 254 pass(es).
[ View ]
flag_hook_flag_default_flags_alter.patch2.13 KBhefox
PASSED: [[SimpleTest]]: [MySQL] 254 pass(es).
[ View ]

Comments

StatusFileSize
new2.59 KB
PASSED: [[SimpleTest]]: [MySQL] 254 pass(es).
[ View ]

adding api entry cause those are cool

Status:Needs review» Needs work

Seems reasonable enough -- allows things like altering Features, or flags provided by modules.

+++ b/flag.api.php
@@ -54,6 +54,15 @@ function hook_flag_default_flags() {
+ * Alter the defination of default flags.

Typo: 'definition'.

+++ b/flag.api.php
@@ -54,6 +54,15 @@ function hook_flag_default_flags() {
+function hook_flag_default_flags_alter(&$flags) {

Needs a @param.

+++ b/flag.module
@@ -1420,32 +1420,37 @@ function flag_get_default_flags($include_disabled = FALSE) {
+      $default_flags_info[$flag_name] = $flag_info += array(

That += can just be a + as we're not doing anything else with $flag_info.

+++ b/flag.module
@@ -1420,32 +1420,37 @@ function flag_get_default_flags($include_disabled = FALSE) {
+  drupal_alter('flag_default_flags', $default_flags_info);

Comment please -- helps find where hooks are invoked.

Status:Needs work» Needs review
StatusFileSize
new2.85 KB
PASSED: [[SimpleTest]]: [MySQL] 266 pass(es).
[ View ]

Here's the patch with feedback from #2 incorporated.