The provision_path() function automatically runs the success and failure messages it is provided through the dt() function for localization, because the function has to provide the @path, @op, and @confirm tokens. This means that messages passed to it should not be run through dt(), as doing so is redundant.

However, in almost all of the places where provision_path is called, dt() is being run on the messages prior to the call.

For example, consider _provision_drupal_create_settings_file():


function _provision_drupal_create_settings_file($url = NULL) {
  $options = drush_get_merged_options();

  // As of Drupal 7 there is no more mysqli type
  if (drush_drupal_major_version() >= 7) {
    $options['db_type'] = ($options['db_type'] == 'mysqli') ? 'mysql' : $options['db_type'];
  }

  $options['extra_config'] = "# Extra configuration from modules:\n";
  $options['extra_config'] .= join("\n", drush_command_invoke_all('provision_drupal_config', $url, $options));

  drush_log(dt("Generate settings.php file"));
  if (provision_path("exists", "sites/$url/settings.php")) {
    provision_path("chmod", "sites/$url/settings.php", 0640,
      dt('Changed permissions of settings.php to @confirm'),  // Should not use dt()
      dt('Could not change permissions of settings.php to @confirm'));  // Should not use dt()
  }

  $fp = fopen("sites/$url/settings.php", "w");
  $text =  _provision_drupal_default_template();
  fwrite($fp, "<?php\n". provision_render_config($text, $options));
  fclose($fp);

  # Change the permissions of the file
  provision_path("chmod", "sites/$url/settings.php", 0440,
    dt('Changed permissions of settings.php to @confirm'),  // Should not use dt()
    dt('Could not change permissions of settings.php to @confirm'));  // Should not use dt()

  provision_path("chgrp", "sites/$url/settings.php", drush_get_option('web_group'),
    dt('Change group ownership of settings.php to @confirm'),  // Should not use dt()
    dt('Could not change group ownership of settings.php to @confirm'));  // Should not use dt()
}

Comments

adrian’s picture

Status: Active » Fixed

provision_path no longer exists, and this has to be reconfigured.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.