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 #3485: Add options_element in backdrop_merged_modules() #2564

Merged
merged 7 commits into from
Apr 10, 2019
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
3 changes: 2 additions & 1 deletion core/includes/module.inc
Original file line number Diff line number Diff line change
Expand Up @@ -985,7 +985,8 @@ function backdrop_merged_modules() {
'pathauto', // Backdrop 1.1.0.
'transliteration', // Backdrop 1.3.0.
'project_browser', // Backdrop 1.4.0.
'entity_view_mode' // Backdrop 1.6.0.
'entity_view_mode', // Backdrop 1.6.0.
'options_element' // Backdrop 1.12.0.
);
}

Expand Down
21 changes: 21 additions & 0 deletions core/modules/field/field.install
Original file line number Diff line number Diff line change
Expand Up @@ -117,3 +117,24 @@ function field_update_1002() {
$role_config->save();
}
}

/**
* Uninstall the options_element contrib module, now part of core.
*/
function field_update_1003() {
$module = db_query("SELECT name FROM {system} WHERE name = 'options_element' AND type = 'module'")->fetchField();
if ($module) {
$path = backdrop_get_path('module', 'options_element');
backdrop_set_message(t('The contributed module <em>Options Element</em> has been located at %path. The module has been disabled, since its functionlity is now provided by Backdrop core. It is recommended that you remove this module from your site.', array('%path' => BACKDROP_ROOT . '/' . $path)), 'warning');
// Remove the entry for the Options Element module from the system table. As
// this module does not provide any config or settings, there doesn't seem
// to be anything else left to clean up or migrate.
// While the contrib module remains in the filesystem, this entry will be
// recreated, but it will have status 0 (disabled), and schema -1
// (uninstalled), so it is safe to remove.
db_query("DELETE FROM {system} WHERE name = 'options_element' AND type = 'module'");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not calling module_disable here ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

module_disable() would call options_element_disable(), as well as allowing other modules to perform uninstall actions. Since we're replacing Options Element with an equivalent, we don't want any modules to react to the change.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fair enough ;)

}
else {
return t('<em>Options Element</em> not found. Nothing to be done.');
}
}