I marked this Feature Request as "Critical Priority" for a specific reason, because of a simple design flaw there are circumstances where novice users, following the official Drupal instructions for upgrading core, can cause a website to crash and become unusable. Please see below for my full explanation:

I just recently started experimenting with Installation Profiles and I have found something that I think is an easy fix but also a very important (even critical) one that will make upgrading Drupal safer and more logical.

What I am proposing is adding a function to the install system that allows for automatically moving any modules and themes folders from the profiles directory to the sites/all directory (or optionally other directories if so needed).

I further propose that this function should run by default unless a special flag is set within the installation profile to prevent that.

As good example of the problem appeared when I installed the profile UberDrupal (beta.8) ... while it installed fine it was based on a slightly older version of core (6.19) and some other contrib modules which were also out of date.

Installation Profiles are very useful for many Drupalers but they are especially useful for first timers who are just trying to get their first Drupal site up and running. As a recent adopter of Drupal and a new learner of PHP I find that even though I know more than a true newbie I still tend to identify with these first timers and their problems a lot.

A newbie would be told that if they wanted to upgrade from 6.19 to 6.20 they should read and follow the offical UPGRADE.txt file in Drupal 6.20 which says:

1. Back up your Drupal database and site root directory. Be especially sure to back up your "sites" directory which contains your configuration file, added modules and themes, and your site's uploaded files. If other files have modifications, such as .htaccess or robots.txt, back those up as well.

. . .

6. Remove all old files and directories from the Drupal installation directory.

NOTE that while there is explicit reference to protecting the sites folder, nowhere in these instructions does it say; "If you used an installation profile make sure you copy the profiles folder."

Following my install of UberDrupal I did attempt such a core upgrade and IF like a newbie I had followed the official core upgrade instructions I would have backed up the sites folder and never known I needed to back up the profiles folder. I would then have deleted the all the core folders including the profiles folder. Since some contrib modules are located in the profiles folder that would have crashed the site due to missing modules. Even if I had backed up the entire root directory I would not have had any way to know the solution depended on the profiles directory subfolders. That is why I marked this feature request Critical priority.

So ... my thinking (and I am a PHP beginner so this may be wrong) is to modify the installer system and the profile file something like this:

function uberdrupal_profile_details() {
  return array(
    'name' => 'UberDrupal',
    'description' => 'Install Drupal with the Acquia Prosper theme by Top Notch Themes and e-commerce functionality provided by Ubercart and other contributed modules.',
    'contrib_destination' => '/sites/all/',  
  );
}

The item 'contrib_destination' contains a standard Drupal path. If it is missing it defaults to '/sites/all/'. To prevent the folders from being moved set this to '/profiles/$profile/'.

In the install_tasks function (install.php) add some code to move the 'modules' and 'themes' folders to the directory defined in the 'contrib_destination' path.

It might be prudent to also add pre-move and post-move hooks here so that if the profile creator needed to move (or copy) a specific file/s to a special destination they could. This same hook could allow them to pre-install other files (such as 3rd party libraries) if needed before continuing with the profile install.

Comments

CJack’s picture

Title: Extremely important feature needed for Installation Profiles » NEEDED: Auto relocate modules and themes folders out of the /profiles directory to prevent problems.

Changed issue name to be more descriptive. Was tired when I wrote this up early this morning.

CJack’s picture

Title: NEEDED: Auto relocate modules and themes folders out of the /profiles directory to prevent problems. » To prevent crashes Modules & Themes folders need to be automatically moved out of /Profiles directory by the installer.
Category: feature » bug
Priority: Critical » Major

Originally I thought this issue should *not* be classified as a bug because everything works ... but ultimately this is a demonstrable and repeatable design flaw that can cause websites to crash and prevent or at least increase the difficulty in upgrading Drupal Core modules, so I am reclassifying this as a Bug Report and downgrading the priority to Major (see excerpt below, emphasis added). I am also changing the title to reflect this category change.

MAJOR: Issues which have significant repercussions but do not render the whole system unusable are marked major. An example would be a PHP error which is only triggered under rare circumstances or which affects only a small percentage of all users.

http://drupal.org/node/45111

Status: Active » Closed (outdated)

Automatically closed because Drupal 6 is no longer supported. If the issue verifiably applies to later versions, please reopen with details and update the version.