summaryrefslogtreecommitdiff
path: root/includes/install.core.inc
diff options
context:
space:
mode:
authorwebchick <webchick@24967.no-reply.drupal.org>2011-11-14 02:34:29 -0500
committerwebchick <webchick@24967.no-reply.drupal.org>2011-11-14 02:34:29 -0500
commit193d1e0bdc4618223d3a8e16075ca4e468f08eb3 (patch)
treed0c7d8cc05c2c26ba6db11e9ed488960863aed0f /includes/install.core.inc
parent6b8eea50a4ea9293b104c23fe362733f40639534 (diff)
downloadbrdo-193d1e0bdc4618223d3a8e16075ca4e468f08eb3.tar.gz
brdo-193d1e0bdc4618223d3a8e16075ca4e468f08eb3.tar.bz2
Issue #655190 by dealancer: Fixed Allow hook_install_tasks() to be called from a profile's .install file (or document that it can't be).
Diffstat (limited to 'includes/install.core.inc')
-rw-r--r--includes/install.core.inc10
1 files changed, 8 insertions, 2 deletions
diff --git a/includes/install.core.inc b/includes/install.core.inc
index 8a590c0c4..6dd086f25 100644
--- a/includes/install.core.inc
+++ b/includes/install.core.inc
@@ -570,6 +570,12 @@ function install_tasks($install_state) {
// Now add any tasks defined by the installation profile.
if (!empty($install_state['parameters']['profile'])) {
+ // Load the profile install file, because it is not always loaded when
+ // hook_install_tasks() is invoked (e.g. batch processing).
+ $profile_install_file = DRUPAL_ROOT . '/profiles/' . $install_state['parameters']['profile'] . '/' . $install_state['parameters']['profile'] . '.install';
+ if (file_exists($profile_install_file)) {
+ include_once $profile_install_file;
+ }
$function = $install_state['parameters']['profile'] . '_install_tasks';
if (function_exists($function)) {
$result = $function($install_state);
@@ -595,7 +601,7 @@ function install_tasks($install_state) {
// Allow the installation profile to modify the full list of tasks.
if (!empty($install_state['parameters']['profile'])) {
$profile_file = DRUPAL_ROOT . '/profiles/' . $install_state['parameters']['profile'] . '/' . $install_state['parameters']['profile'] . '.profile';
- if (is_file($profile_file)) {
+ if (file_exists($profile_file)) {
include_once $profile_file;
$function = $install_state['parameters']['profile'] . '_install_tasks_alter';
if (function_exists($function)) {
@@ -1300,7 +1306,7 @@ function install_already_done_error() {
*/
function install_load_profile(&$install_state) {
$profile_file = DRUPAL_ROOT . '/profiles/' . $install_state['parameters']['profile'] . '/' . $install_state['parameters']['profile'] . '.profile';
- if (is_file($profile_file)) {
+ if (file_exists($profile_file)) {
include_once $profile_file;
$install_state['profile_info'] = install_profile_info($install_state['parameters']['profile'], $install_state['parameters']['locale']);
}