From 1673844210e9075ae8c8ba787e2a8e5b78fe81cc Mon Sep 17 00:00:00 2001
From: Alex Pott <alex.a.pott@googlemail.com>
Date: Tue, 31 Mar 2015 15:44:31 +0100
Subject: [PATCH] Issue #2392221 by er.pushpinderrana, ClientGuy, zealfire:
 install_run_task() and install_tasks() don't document the task structure

---
 core/includes/install.core.inc     |  9 +++++++--
 core/modules/system/module.api.php | 12 ++++++++++--
 2 files changed, 17 insertions(+), 4 deletions(-)

diff --git a/core/includes/install.core.inc b/core/includes/install.core.inc
index a6e918f0bed9..dbab96b44364 100644
--- a/core/includes/install.core.inc
+++ b/core/includes/install.core.inc
@@ -545,7 +545,8 @@ function install_run_tasks(&$install_state) {
  * Runs an individual installation task.
  *
  * @param $task
- *   An array of information about the task to be run.
+ *   An array of information about the task array as returned by
+ *   hook_install_tasks().
  * @param $install_state
  *   An array of information about the current installation state. This is
  *   passed in by reference so that it can be modified by the task.
@@ -678,11 +679,15 @@ function install_tasks_to_perform($install_state) {
  * hasn't been selected yet, we don't yet know which profile tasks will be
  * available).
  *
+ * You can override this using hook_install_tasks()
+ * or hook_install_tasks_alter().
+ *
  * @param $install_state
  *   An array of information about the current installation state.
  *
  * @return
- *   A list of tasks, with associated metadata.
+ *   A list of tasks, with associated metadata as returned by
+ *   hook_install_tasks().
  */
 function install_tasks($install_state) {
   // Determine whether a translation file must be imported during the
diff --git a/core/modules/system/module.api.php b/core/modules/system/module.api.php
index 08344a4975bf..52b77afc329a 100644
--- a/core/modules/system/module.api.php
+++ b/core/modules/system/module.api.php
@@ -233,8 +233,9 @@ function hook_uninstall() {
  *
  * Any tasks you define here will be run, in order, after the installer has
  * finished the site configuration step but before it has moved on to the
- * final import of languages and the end of the installation. You can have any
- * number of custom tasks to perform during this phase.
+ * final import of languages and the end of the installation. This is invoked
+ * by install_tasks(). You can have any number of custom tasks to perform
+ * during this phase.
  *
  * Each task you define here corresponds to a callback function which you must
  * separately define and which is called when your task is run. This function
@@ -327,6 +328,8 @@ function hook_uninstall() {
  *
  * @see install_state_defaults()
  * @see batch_set()
+ * @see hook_install_tasks_alter()
+ * @see install_tasks()
  */
 function hook_install_tasks(&$install_state) {
   // Here, we define a variable to allow tasks to indicate that a particular,
@@ -396,12 +399,17 @@ function hook_install_tasks(&$install_state) {
  * You can use this hook to change or replace any part of the Drupal
  * installation process that occurs after the installation profile is selected.
  *
+ * This hook is invoked on the install profile in install_tasks().
+ *
  * @param $tasks
  *   An array of all available installation tasks, including those provided by
  *   Drupal core. You can modify this array to change or replace individual
  *   steps within the installation process.
  * @param $install_state
  *   An array of information about the current installation state.
+ *
+ * @see hook_install_tasks()
+ * @see install_tasks()
  */
 function hook_install_tasks_alter(&$tasks, $install_state) {
   // Replace the entire site configuration form provided by Drupal core
-- 
GitLab