Verified Commit 1a17e781 authored by Lee Rowlands's avatar Lee Rowlands
Browse files

Issue #3490296 by nicxvan: Mark hook_install_tasks and hook_install_tasks_alter as procedural only

(cherry picked from commit 76323d65)
parent 787dcbc2
Loading
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -1659,6 +1659,8 @@
 *
 * Install hooks:
 * - hook_install()
 * - hook_install_tasks()
 * - hook_install_tasks_alter()
 * - hook_post_update_NAME()
 * - hook_schema()
 * - hook_uninstall()
+2 −4
Original line number Diff line number Diff line
@@ -705,10 +705,8 @@ protected function uninstallSchema(string $module): void {
   *
   * Hooks called during install will remain procedural.
   * - hook_install()
   * - hook_module_preinstall()
   * - hook_module_preuninstall()
   * - hook_modules_installed()
   * - hook_modules_uninstalled()
   * - hook_install_tasks()
   * - hook_install_tasks_alter()
   * - hook_post_update_NAME()
   * - hook_schema()
   * - hook_uninstall()
+4 −0
Original line number Diff line number Diff line
@@ -349,6 +349,8 @@ function hook_uninstall($is_syncing): void {
/**
 * Return an array of tasks to be performed by an installation profile.
 *
 * Only procedural implementations are supported for this hook.
 *
 * 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. This is invoked
@@ -513,6 +515,8 @@ function hook_install_tasks(&$install_state) {
/**
 * Alter the full list of installation tasks.
 *
 * Only procedural implementations are supported for this hook.
 *
 * You can use this hook to change or replace any part of the Drupal
 * installation process that occurs after the installation profile is selected.
 *
+2 −0
Original line number Diff line number Diff line
@@ -67,6 +67,8 @@
 *
 * Install hooks:
 * - hook_install()
 * - hook_install_tasks()
 * - hook_install_tasks_alter()
 * - hook_post_update_NAME()
 * - hook_schema()
 * - hook_uninstall()
+2 −0
Original line number Diff line number Diff line
@@ -366,6 +366,8 @@ public static function checkForProceduralOnlyHooks(Hook $hook, string $class): v
      'schema',
      'uninstall',
      'update_last_removed',
      'hook_install_tasks',
      'hook_install_tasks_alter',
    ];

    if (in_array($hook->hook, $staticDenyHooks) || preg_match('/^(post_update_|preprocess_|process_|update_\d+$)/', $hook->hook)) {