Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 292538

Use Install/Uninstall consistently for turning modules/themes on/off (not Enable)

$
0
0

Problem/Motivation

There is a UI that lets you turn a module/theme on/off. Turning it on adds configuration and often database tables. Turning it off removes content, configuration, and/or database tables. The UI for this should consistently use the verbs "Install" and "Uninstall". Currently it mostly does use these verbs, but it says "Enable" in a few places.

Steps:
1. Go to /admin/modules

2. Click Install new module (see issue #2577407: Action of uploading module/theme files should consistently be called "Add", not "Install" -- this should say "Add" -- being fixed there)

3. Paste in a URL for a module

4. Click Install (should say Continue or Add, being fixed on #2577407: Action of uploading module/theme files should consistently be called "Add", not "Install"). When it completes, you'll see:

If you're instead doing a theme, you'll see:
step-2

5. Click Enable newly added modules, which takes you back to admin/modules

6. Check Token (or some other module)

7. Click Install

You will see a message saying
Module [module name] has been enabled.

Also, on the Theme page, to turn on a theme, the link says "Enable":
step-3

This is very confusing UI, since the terms "Install" and "Enable" are being used interchangeably.

The Uninstall pages also need attention.

Here are the places in the code base that seem to be using "enable" or "disable" instead of "install" and "uninstall":

  1. ./modules/system/src/Form/ModulesListConfirmForm.php: $items[] = $this->formatPlural(count($dependencies), 'You must enable the @required module to install @module.', 'You must enable the @required modules to install @module.', [
    Cute! It uses "enable" and "install" in the same sentence to mean the same thing!?! Many of the others here do the same thing.
  2. ./modules/system/src/Form/ThemeExperimentalConfirmForm.php: $items[] = $this->formatPlural(count($dependencies), 'You must enable the @required theme to install @theme.', 'You must enable the @required themes to install @theme.', [
  3. ./modules/system/system.module:        $output .= '<p>' . t('Regularly review available updates to maintain a secure and current site. Always run the <a href=":update-php">update script</a> each time a module is updated. Enable the <a href=":update-manager">Update Manager module</a> to update and install modules and themes.', [':update-php' => Url::fromRoute('system.db_update')->toString(), ':update-manager' => Url::fromRoute('system.modules_list', [], ['fragment' => 'module-
    update'])->toString()]) . '</p>';
  4. ./modules/image/image.install: 'description' => t("No image toolkit is configured on the site. Check PHP installed extensions or add a contributed toolkit that doesn't require a PHP extension. Make sure that at least one valid image toolkit is enabled."),
    I'm not sure about this one... maybe this actually should say "enabled"? Will need to check on the wording for image toolkits elsewhere.
  5. ./modules/editor/editor.module: $output .= '<dd>' . t('The Text Editor module provides a framework for managing editors. To use it, you also need to enable a text editor. This can either be the core <a href=":ckeditor">CKEditor module</a>, which can be enabled on the <a href=":extend">Extend page</a>, or a contributed module for any other text editor. When installing a contributed text editor module, be sure to check the installation instructions, because you will most likely need to download and install an external library as well as the Drupal module.', [':ckeditor' => (\Drupal::moduleHandler()->moduleExists('ckeditor')) ? Url::fromRoute('help.page', ['name' => 'ckeditor'])->toString() : '#', ':extend' => Url::fromRoute('system.modules_list')->toString()]) . '</dd>';
  6. ./modules/update/update.compare.inc:          'data' => t('Your currently installed release has been revoked, and is no longer available for download. Disabling everything included in this release or upgrading is strongly recommended!'),
    ...
    ./modules/update/update.compare.inc:          'data' => t('Your currently installed release is now unsupported, and is no longer available for download. Disabling everything included in this release or upgrading is strongly recommended!'),
    
  7. ./modules/update/update.module:        $text = t('The installed version of at least one of your modules or themes has been revoked and is no longer available for download. Upgrading or disabling is strongly recommended!', [], ['langcode' => $langcode]);
    ./modules/update/update.module:        $text = t('The installed version of at least one of your modules or themes is no longer supported. Upgrading or disabling is strongly recommended. See the project homepage for more details.', [], ['langcode' => $langcode]);
    

    I have no idea why these two messages are subtly different "has been revoked" or "is no longer supported"? Anyway, it should not say "disabling".

  8. ./modules/migrate_drupal_ui/src/Form/OverviewForm.php: $info[] = $this->t('<strong>Enable all modules on this new site</strong> that are enabled on the old site. For example, if the old site uses the Book module, then enable the Book module on this new site so that the existing data can be imported to it.');
  9. ./modules/migrate_drupal_ui/migrate_drupal_ui.install: \Drupal::messenger()->addStatus(t('The Migrate Drupal UI module has been enabled. Proceed to the <a href=":url">upgrade form</a>.', [':url' => $url]));
  10. ./modules/migrate_drupal_ui/migrate_drupal_ui.module: $output .= '<dd>' . t('You need to enable all modules on this site that are enabled on the previous site. For example, if you have used the Book module on the previous site then you must enable the Book module on this site for that data to be available on this site.') . '</dd>';
  11. ./modules/book/book.module: $output .= '<p>' . t('The Book module is used for creating structured, multi-page content, such as site resource guides, manuals, and wikis. It allows you to create content that has chapters, sections, subsections, or any similarly-tiered structure. Enabling the module creates a new content type <em>Book page</em>. For more information, see the <a href=":book">online documentation for the Book module</a>.', [':book' => 'https://www.drupal.org/documentation/modules/book']) . '</p>';
  12. ./modules/comment/comment.module:      $output .= '<dd>' . t('Comment functionality can be enabled for any entity sub-type (for example, a <a href=":content-type">content type</a>) by adding a <em>Comments</em> field on its <em>Manage field
    s page</em>. Adding or removing commenting for an entity through the user interface requires the <a href=":field_ui">Field UI</a> module to be enabled, even though the commenting functionality works without it. For more information on fields and entities, see the <a href=":field">Field module help page</a>.', [':content-type' => (\Drupal::moduleHandler()->moduleExists('node')) ? Url::fromRoute('entity.node_type.collection')->toString() : '#', ':field' => Url::fromRoute('help.
    page', ['name' => 'field'])->toString(), ':field_ui' => (\Drupal::moduleHandler()->moduleExists('field_ui')) ? Url::fromRoute('help.page', ['name' => 'field_ui'])->toString() : '#']) . '</dd>';
    ...
    ./modules/comment/comment.module:      $output .= '<dd>' . t('Commenting settings can be configured by editing the <em>Comments</em> field on the <em>Manage fields page</em> of an entity type if the <em>Field UI module</em> is enabled. Configuration includes the label of the comments field, the number of comments to be displayed, and whether they are shown in threaded list. Commenting can be configured as: <em>Open</em> to allow new comments, <em>Closed</em> to view existing 
    comments, but prevent new comments, or <em>Hidden</em> to hide existing comments and prevent new comments. Changing this configuration for an entity type will not change existing entity items.') . '</dd>';
    

    Note that only the part that talks about enabling the Field UI module needs to be fixed here.

  13. ./modules/locale/locale.module:      $output .= '<dd>' . t('Translation files with translated interface text are imported automatically when languages are added on the <a href=":languages">Languages</a> page, or when modules or themes are enabled. On the <a href=":locale-settings">Interface translation settings</a> page, the <em>Translation source</em> can be restricted to local files only, or to include the <a href=":server">Drupal translation server</a>. Although modules and themes may not be fully translated in all languages, new translations become available frequently. You can specify whether and how often to check for translation file updates and whether to overwrite existing translations on the <a href=":locale-settings">Interface translation settings</a> page. You can also manually import a translation file on the <a href=":import">Interface translation import</a> page.', [':import' => Url::fromRoute('locale.translate_import')->toString(), ':locale-settings' => Url::fromRoute('locale.settings')->toString(), ':languag
    es' => Url::fromRoute('entity.configurable_language.collection')->toString(), ':server' => 'https://localize.drupal.org']) . '</dd>';
    
    ./modules/locale/locale.module:      $output .= '<dd>' . t('If translation is enabled for English, you can <em>override</em> the default English interface text strings in your site with other English text strings on the <a href=":translate">User interface translation</a> page. Translation is off by default for English, but you can turn it on by visiting the <em>Edit language</em> page for <em>Engl
    ish</em> from the <a href=":languages">Languages</a> page.', [':translate' => Url::fromRoute('locale.translate_page')->toString(), ':languages' => Url::fromRoute('entity.configurable_language.collection')->toString()]) . '</dd>';
    
    ./modules/locale/locale.module:      return '<p>' . t('Interface translations are automatically imported when a language is added, or when new modules or themes are enabled. The report <a href=":update">Available translation updates</a> shows the status. Interface text can be customized in the <a href=":translate">user interface translation</a> page.', [':update' => Url::fromRoute('locale.translat
    e_status')->toString(), ':translate' => Url::fromRoute('locale.translate_page')->toString()]) . '</p>';
    
    ./modules/locale/locale.module:      $output = '<p>' . t('Translation files are automatically downloaded and imported when <a title="Languages" href=":language">languages</a> are added, or when modules or themes are enabled.', [':language' => Url::fromRoute('entity.configurable_language.collection')->toString()]) . '</p>';
    
  14. ./modules/forum/forum.module: $output .= '<dd>' . t('Enabling the Forum module provides a default <em>Forums</em> menu link in the Tools menu that links to the <a href=":forums">Forums page</a>.', [':forums' => Url::fromRoute('forum.index')->toString()]) . '</dd>';
  15. ./modules/field/field.module:      $output .= '<dd>' . t('The Field module provides the infrastructure for fields; the field types, formatters, and widgets are provided by Drupal core or additional modules. Some of the modules are required; the optional modules can be enabled from the <a href=":modules">Extend administration page</a>. Additional fields, formatters, and widgets may be provided by contributed modules, which you can find in the <a href=":contrib">contributed module section of Drupal.org</a>.', [':modules' => Url::fromRoute('system.modules_list')->toString(), ':contrib' => 'https://www.drupal.org/project/modules']) . '</dd>';
    
    ./modules/field/field.module:        $output .= '<dd>' . t('Here is a list of the currently enabled field, formatter, and widget modules:');
    
  16. ./modules/search/search.module:      $output .= '<dd>' . t('Modules providing search page plugins generally ensure that content-related actions on your site (creating, editing, or deleting content and comments) automatically cause affected content items to be marked for indexing or reindexing at the next cron run. When content is marked for reindexing, the previous content remains in the index until cron runs, at which time it is replaced by the new content. However, there are some actions related to the structure of your site that do not cause affected content to be marked for reindexing. Examples of structure-related actions that affect content include deleting or editing taxonomy terms, enabling or disabling modules that add text to content (such as Taxonomy, Comment, and field-providing modules), and modifying the fields or display parameters of your content types. If you take one of these actions and you want to ensure that the search index is updated to reflect your changed site structure, you can mark all content for reindexing by clicking the "Re-index site" button on the <a href=":search-settings">Search pages page</a>. If you have a lot of content on your site, it may take several cron runs for the content to be reindexed.', [':search-settings' => Url::fromRoute('entity.search_page.collection')->toString()]) . '</dd>';
    
    ./modules/search/search.module:      $output .= '<dd>' . t('The Search module includes a block, which can be enabled and configured on the <a href=":blocks">Block layout page</a>, if you have the Block module enabled; the default block title is Search, and it is the Search form block in the Forms category, if you wish to add another instance. The block is available to users with the <a href=":sear
    ch_permission">Use search</a> permission, and it performs a search using the configured default search page.', [':blocks' => (\Drupal::moduleHandler()->moduleExists('block')) ? Url::fromRoute('block.admin_display')->toString() : '#', ':search_permission' => Url::fromRoute('user.admin_permissions', [], ['fragment' => 'module-search'])->toString()]) . '</dd>';
    
  17. ./modules/user/src/AccountSettingsForm.php: '#description' => $this->t('This role will be automatically assigned new permissions whenever a module is enabled. Changing this setting will not affect existing permissions.'),
  18. ./modules/user/user.module:      $output .= '<dd>' . t('<em>Roles</em> are used to group and classify users; each user can be assigned one or more roles. Typically there are two pre-defined roles: <em>Anonymous user</em> (users that are not
     logged in), and <em>Authenticated user</em> (users that are registered and logged in). Depending on how your site was set up, an <em>Administrator</em> role may also be available: users with this role will automatically be assigned any new permissions whenever a module is enabled. You can create additional roles on the <a href=":roles">Roles administration page</a>.', [':roles' => Url::fromRoute('entity.user_role.collection')->toString()]) . '</dd>';
    
    ./modules/user/user.module:      $output .= '<dd>' . t('The <a href=":accounts">Account settings page</a> allows you to manage settings for the displayed name of the Anonymous user role, personal contact forms, user registration settings, and account cancellation settings. On this page you can also manage settings for account personalization, and adapt the text for the email messages that users receive when they register or request a password recovery. You may also set which role is automatically assigned new permissions whenever a module is enabled (the Administrator role).', [':accounts' => Url::fromRoute('entity.user.admin_form')
    ->toString()]) . '</dd>';
  19. ./modules/menu_link_content/menu_link_content.module:        $output .= '' . t('For more information, see the <a href=":drupal-org-help">online documentation for the Custom Menu Links module</a>. If you enable the Menu UI module, it provides an interface for managing menus and menu links.', [':drupal-org-help' => 'https://www.drupal.org/documentation/modules/menu_link']);
    
  20. There are a lot more.....

Proposed resolution

The UI for this should consistently use the verbs "Install" and "Uninstall" for turning a module/theme on/off.

Remaining tasks

Re scope into small child issues
Make a patch that updates the UI for turning a module/theme on/off so it always uses the verbs "Install" and "Uninstall".

User interface changes

More consistent wording.

API changes

Not on this issue. See #2888657-23: [meta] Less confusing and more consistent wording needed in module/theme add/install/update for other related proposed changes.

Data model changes

None.

Release notes snippet

TBD

People to credit

Duplicate issue #2856038: Confusing instructions when installing a theme in D8: Please credit dbjpanda , yogeshmpawar, gaurav.kapoor, cilefen, joelpittet


Viewing all articles
Browse latest Browse all 292538

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>