Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue #4: ensure flag config and sample views handled properly #48

Merged
merged 1 commit into from
Dec 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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();
}
}
}