Skip to content

Commit

Permalink
Issue #4: ensure flag config and sample views handled properly (#48)
Browse files Browse the repository at this point in the history
  • Loading branch information
herbdool authored Dec 30, 2023
1 parent 36717cc commit 0c1eb4a
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
5 changes: 5 additions & 0 deletions flag.module
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ function flag_config_info() {
'label' => t('Flag settings'),
'group' => t('Configuration'),
);
$prefixes['flag.flag'] = array(
'name_key' => 'name',
'label_key' => 'title',
'group' => t('Flags'),
);
return $prefixes;
}

Expand Down
18 changes: 16 additions & 2 deletions modules/flag_bookmark/flag_bookmark.install
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,20 @@ function flag_bookmark_enable() {
}
}

/**
* Implements hook_uninstall().
*/
function flag_bookmark_uninstall() {
// Remove default, un-modified views.
foreach (array('flag_bookmarks', 'flag_bookmarks_tab') as $view) {
$config = config('views.view.' . $view);
// Only update if view isn't overridden (VIEWS_STORAGE_OVERRIDE).
if ($config->get('storage') != 2) {
$config->delete();
}
}
}

/**
* Returns some node types to which the demonstration 'bookmarks' flag will
* apply.
Expand Down Expand Up @@ -260,7 +274,7 @@ function flag_bookmark_update_1000() {
),
)
);
$config->save();
$config->save();
}

$config = config('views.view.flag_bookmarks');
Expand Down Expand Up @@ -432,4 +446,4 @@ function flag_bookmark_update_1000() {
);
$config->save();
}
}
}

0 comments on commit 0c1eb4a

Please sign in to comment.