Skip to content

Commit 0c1eb4a

Browse files
authored
Issue #4: ensure flag config and sample views handled properly (#48)
1 parent 36717cc commit 0c1eb4a

File tree

2 files changed

+21
-2
lines changed

2 files changed

+21
-2
lines changed

flag.module

+5
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@ function flag_config_info() {
1818
'label' => t('Flag settings'),
1919
'group' => t('Configuration'),
2020
);
21+
$prefixes['flag.flag'] = array(
22+
'name_key' => 'name',
23+
'label_key' => 'title',
24+
'group' => t('Flags'),
25+
);
2126
return $prefixes;
2227
}
2328

modules/flag_bookmark/flag_bookmark.install

+16-2
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,20 @@ function flag_bookmark_enable() {
5252
}
5353
}
5454

55+
/**
56+
* Implements hook_uninstall().
57+
*/
58+
function flag_bookmark_uninstall() {
59+
// Remove default, un-modified views.
60+
foreach (array('flag_bookmarks', 'flag_bookmarks_tab') as $view) {
61+
$config = config('views.view.' . $view);
62+
// Only update if view isn't overridden (VIEWS_STORAGE_OVERRIDE).
63+
if ($config->get('storage') != 2) {
64+
$config->delete();
65+
}
66+
}
67+
}
68+
5569
/**
5670
* Returns some node types to which the demonstration 'bookmarks' flag will
5771
* apply.
@@ -260,7 +274,7 @@ function flag_bookmark_update_1000() {
260274
),
261275
)
262276
);
263-
$config->save();
277+
$config->save();
264278
}
265279

266280
$config = config('views.view.flag_bookmarks');
@@ -432,4 +446,4 @@ function flag_bookmark_update_1000() {
432446
);
433447
$config->save();
434448
}
435-
}
449+
}

0 commit comments

Comments
 (0)