Commit cfcf40d0 authored by catch's avatar catch
Browse files

Issue #2577407 by vulcanr, jhodgdon, Sagar Ramgade, snehi, brahmjeet789,...

Issue #2577407 by vulcanr, jhodgdon, Sagar Ramgade, snehi, brahmjeet789, Manjit.Singh, Tony-Mac, ressa, xjm, cilefen, sajosh, ifrik, Charles Belov, Bojhan, David_Rothstein, Gábor Hojtsy, tkoleary, longwave, NickDickinsonWilde, nishantkumar155, shell_cm, greta_drupal, YesCT: Action of uploading module/theme files should consistently be called "Add", not "Install"
parent 469ed5d2
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -175,7 +175,7 @@ public function validateForm(array &$form, FormStateInterface $form_state) {
      catch (\Exception $e) {
        // The format of this error message is similar to that used on the
        // database connection form in the installer.
        $form_state->setErrorByName('connection_settings', $this->t('Failed to connect to the server. The server reports the following message: <p class="error">@message</p> For more help installing or updating code on your server, see the <a href=":handbook_url">handbook</a>.', [
        $form_state->setErrorByName('connection_settings', $this->t('Failed to connect to the server. The server reports the following message: <p class="error">@message</p> For more help adding or updating code on your server, see the <a href=":handbook_url">handbook</a>.', [
          '@message' => $e->getMessage(),
          ':handbook_url' => 'https://www.drupal.org/docs/8/extending-drupal-8/overview',
        ]));
+1 −1
Original line number Diff line number Diff line
@@ -119,7 +119,7 @@ public function postInstallTasks() {
    return [
      $default_options + [
        '#url' => Url::fromRoute('update.module_install'),
        '#title' => t('Install another module'),
        '#title' => t('Add another module'),
      ],
      $default_options + [
        '#url' => Url::fromRoute('system.modules_list'),
+1 −1
Original line number Diff line number Diff line
@@ -111,7 +111,7 @@ function system_help($route_name, RouteMatchInterface $route_match) {
      return '<p>' . t('Control default display settings for your site, across all themes. Use theme-specific settings to override these defaults.') . '</p>';

    case 'system.modules_list':
      $output = '<p>' . t('Download additional <a href=":modules">contributed modules</a> to extend your site\'s functionality.', [':modules' => 'https://www.drupal.org/project/modules']) . '</p>';
      $output = '<p>' . t('Add <a href=":modules">contributed modules</a> to extend your site\'s functionality.', [':modules' => 'https://www.drupal.org/project/modules']) . '</p>';
      if (!\Drupal::moduleHandler()->moduleExists('update')) {
        $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>';
      }
+5 −5
Original line number Diff line number Diff line
@@ -107,7 +107,7 @@ public function buildForm(array $form, FormStateInterface $form_state) {

    $form['project_url'] = [
      '#type' => 'url',
      '#title' => $this->t('Install from a URL'),
      '#title' => $this->t('Add from a URL'),
      '#description' => $this->t('For example: %url', ['%url' => 'https://ftp.drupal.org/files/projects/name.tar.gz']),
    ];

@@ -119,7 +119,7 @@ public function buildForm(array $form, FormStateInterface $form_state) {

    $form['project_upload'] = [
      '#type' => 'file',
      '#title' => $this->t('Upload a module or theme archive to install'),
      '#title' => $this->t('Upload a module or theme archive'),
      '#description' => $this->t('For example: %filename from your local computer', ['%filename' => 'name.tar.gz']),
    ];

@@ -127,7 +127,7 @@ public function buildForm(array $form, FormStateInterface $form_state) {
    $form['actions']['submit'] = [
      '#type' => 'submit',
      '#button_type' => 'primary',
      '#value' => $this->t('Install'),
      '#value' => $this->t('Continue'),
    ];

    return $form;
@@ -139,7 +139,7 @@ public function buildForm(array $form, FormStateInterface $form_state) {
  public function validateForm(array &$form, FormStateInterface $form_state) {
    $all_files = $this->getRequest()->files->get('files', []);
    if (!($form_state->getValue('project_url') xor !empty($all_files['project_upload']))) {
      $form_state->setErrorByName('project_url', $this->t('You must either provide a URL or upload an archive file to install.'));
      $form_state->setErrorByName('project_url', $this->t('You must either provide a URL or upload an archive file.'));
    }
  }

@@ -224,7 +224,7 @@ public function submitForm(array &$form, FormStateInterface $form_state) {
    }

    if ($updater->isInstalled()) {
      $this->messenger()->addError($this->t('%project is already installed.', ['%project' => $project_title]));
      $this->messenger()->addError($this->t('%project is already present.', ['%project' => $project_title]));
      return;
    }

+2 −2
Original line number Diff line number Diff line
@@ -57,13 +57,13 @@ public function testViaAuthorize($url) {
    $edit = [
      'project_url' => $url,
    ];
    $this->drupalPostForm('admin/modules/install', $edit, 'Install');
    $this->drupalPostForm('admin/modules/install', $edit, 'Continue');
    $edit = [
      'connection_settings[authorize_filetransfer_default]' => 'system_test',
      'connection_settings[system_test][update_test_username]' => $this->randomMachineName(),
    ];
    $this->submitForm($edit, 'Continue');
    $this->assertText('Installation was completed successfully.');
    $this->assertText('Files were added successfully.');

    // Ensure the module is available to install.
    $this->drupalGet('admin/modules');
Loading