diff --git a/core/modules/update/lib/Drupal/update/Access/UpdateManagerAccess.php b/core/modules/update/lib/Drupal/update/Access/UpdateManagerAccess.php index bb34ed5..93b47b2 100644 --- a/core/modules/update/lib/Drupal/update/Access/UpdateManagerAccess.php +++ b/core/modules/update/lib/Drupal/update/Access/UpdateManagerAccess.php @@ -18,17 +18,17 @@ class UpdateManagerAccess implements AccessCheckInterface { /** - * The object which works with settings is in settings.php. + * The settings service. * * @var \Drupal\Component\Utility\Settings */ protected $settings; /** - * Constructs UpdateManagerAccess object. + * Constructs an UpdateManagerAccess object. * * @param \Drupal\Component\Utility\Settings $settings - * The object which works with settings is in settings.php. + * An object containing environment specific read-only settings. */ public function __construct(Settings $settings) { $this->settings = $settings; diff --git a/core/modules/update/lib/Drupal/update/Form/UpdateManagerInstall.php b/core/modules/update/lib/Drupal/update/Form/UpdateManagerInstall.php index 575f7ac..cd88772 100644 --- a/core/modules/update/lib/Drupal/update/Form/UpdateManagerInstall.php +++ b/core/modules/update/lib/Drupal/update/Form/UpdateManagerInstall.php @@ -28,11 +28,11 @@ class UpdateManagerInstall extends FormBase { /** * Constructs a new UpdateManagerInstall. * - * @param \Drupal\Core\Extension\ModuleHandlerInterface $moduleHandler + * @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler * The module handler. */ - public function __construct(ModuleHandlerInterface $moduleHandler) { - $this->moduleHandler = $moduleHandler; + public function __construct(ModuleHandlerInterface $module_handler) { + $this->moduleHandler = $module_handler; } /** @@ -125,8 +125,8 @@ public function submitForm(array &$form, array &$form_state) { $validators = array('file_validate_extensions' => array(archiver_get_extensions())); $field = 'project_upload'; if (!($finfo = file_save_upload($field, $validators, NULL, 0, FILE_EXISTS_REPLACE))) { - // Failed to upload the file. file_save_upload() calls form_set_error() on - // failure. + // Failed to upload the file. file_save_upload() calls form_set_error() + // on failure. return; } $local_cache = $finfo->getFileUri(); @@ -147,9 +147,9 @@ public function submitForm(array &$form, array &$form_state) { return; } - // Unfortunately, we can only use the directory name to determine the project - // name. Some archivers list the first file as the directory (i.e., MODULE/) - // and others list an actual file (i.e., MODULE/README.TXT). + // Unfortunately, we can only use the directory name to determine the + // project name. Some archivers list the first file as the directory (i.e., + // MODULE/) and others list an actual file (i.e., MODULE/README.TXT). $project = strtok($files[0], '/\\'); $archive_errors = $this->moduleHandler->invokeAll('verify_update_archive', array($project, $local_cache, $directory)); @@ -201,11 +201,11 @@ public function submitForm(array &$form, array &$form_state) { 'local_url' => $project_real_location, ); - // If the owner of the directory we extracted is the same as the - // owner of our configuration directory (e.g. sites/default) where we're - // trying to install the code, there's no need to prompt for FTP/SSH - // credentials. Instead, we instantiate a Drupal\Core\FileTransfer\Local and - // invoke update_authorize_run_install() directly. + // If the owner of the directory we extracted is the same as the owner of + // our configuration directory (e.g. sites/default) where we're trying to + // install the code, there's no need to prompt for FTP/SSH credentials. + // Instead, we instantiate a Drupal\Core\FileTransfer\Local and invoke + // update_authorize_run_install() directly. if (fileowner($project_real_location) == fileowner(conf_path())) { $this->moduleHandler->loadInclude('update', 'inc', 'update.authorize'); $filetransfer = new Local(DRUPAL_ROOT); @@ -220,4 +220,5 @@ public function submitForm(array &$form, array &$form_state) { $form_state['redirect'] = system_authorized_get_url(); } } + } diff --git a/core/modules/update/lib/Drupal/update/Form/UpdateManagerUpdate.php b/core/modules/update/lib/Drupal/update/Form/UpdateManagerUpdate.php index 6d757b8..5fcc03b 100644 --- a/core/modules/update/lib/Drupal/update/Form/UpdateManagerUpdate.php +++ b/core/modules/update/lib/Drupal/update/Form/UpdateManagerUpdate.php @@ -38,7 +38,8 @@ class UpdateManagerUpdate extends FormBase { * @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler * The module handler. * @param \Drupal\Core\KeyValueStore\KeyValueStoreInterface $state - * The state key/value store interface, gives access to state based config settings. + * The state key/value store interface, gives access to state based config + * settings. */ public function __construct(ModuleHandlerInterface $module_handler, KeyValueStoreInterface $state) { $this->moduleHandler = $module_handler; @@ -323,4 +324,5 @@ public function submitForm(array &$form, array &$form_state) { ); batch_set($batch); } + } diff --git a/core/modules/update/lib/Drupal/update/Form/UpdateReady.php b/core/modules/update/lib/Drupal/update/Form/UpdateReady.php index eccd689..2400e44 100644 --- a/core/modules/update/lib/Drupal/update/Form/UpdateReady.php +++ b/core/modules/update/lib/Drupal/update/Form/UpdateReady.php @@ -104,7 +104,6 @@ public function submitForm(array &$form, array &$form_state) { } if (!empty($_SESSION['update_manager_update_projects'])) { - $updates = array(); $directory = _update_manager_extract_directory(); @@ -126,8 +125,8 @@ public function submitForm(array &$form, array &$form_state) { // If the owner of the last directory we extracted is the same as the // owner of our configuration directory (e.g. sites/default) where we're // trying to install the code, there's no need to prompt for FTP/SSH - // credentials. Instead, we instantiate a Drupal\Core\FileTransfer\Local and - // invoke update_authorize_run_update() directly. + // credentials. Instead, we instantiate a Drupal\Core\FileTransfer\Local + // and invoke update_authorize_run_update() directly. if (fileowner($project_real_location) == fileowner(conf_path())) { $this->moduleHandler->loadInclude('update', 'inc', 'update.authorize'); $filetransfer = new Local(DRUPAL_ROOT); @@ -143,4 +142,5 @@ public function submitForm(array &$form, array &$form_state) { } parent::submitForm($form, $form_state); } + } diff --git a/core/modules/update/update.local_actions.yml b/core/modules/update/update.local_actions.yml new file mode 100644 index 0000000..5b93116 --- /dev/null +++ b/core/modules/update/update.local_actions.yml @@ -0,0 +1,5 @@ +update_report_install: + route_name: update_report_install + title: 'Install new module or theme' + appears_on: + - update_status diff --git a/core/modules/update/update.module b/core/modules/update/update.module index 2bcc5c5..ad01bb7 100644 --- a/core/modules/update/update.module +++ b/core/modules/update/update.module @@ -222,21 +222,6 @@ function update_menu() { } /** - * Implements hook_local_actions(). - */ -function update_local_actions() { - return array( - array( - 'route_name' => 'update_report_install', - 'title' => t('Install new module or theme'), - 'appears_on' => array( - 'update_status', - ), - ), - ); -} - -/** * Access callback: Resolves if the current user can access updater menu items. * * It both enforces the 'administer software updates' permission and the global