I'm making a directory 'profiles/foo' that will have 'foo_bar.profile' and 'foo_baz.profile' in it. When installing you can choose either of these, but when you choose foo_bar for example and click submit you get:

Warning: install_main(./profiles/foo_bar/foo_bar.profile): failed to open stream: No such file or directory in C:\!WEB\sites\common\drupal_HEAD_just_core_2\install.php on line 65

Fatal error: install_main(): Failed opening required './profiles/foo_bar/foo_bar.profile' (include_path='.;C:\!WEB\xampp\php\pear\;C:\!WEB\share;C:\!WEB\share\myscripts') in C:\!WEB\sites\common\drupal_HEAD_just_core_2\install.php on line 65

This is due to the fact that the installer has it hardcoded to look for the exact profile name as the directory. We should be flexible with these as we are with modules so we can group similar profiles together like modules and themes.

Comments

lilou’s picture

Version: x.y.z » 7.x-dev

Which version of drupal is concerned ?

This bug is it still valid ?

mr.baileys’s picture

Component: update system » install system

Marked #290737: Errors when install profile file and directory name differ as a duplicate of this one (does contain detailed information about this bug in 7.x-dev)

Pedro Lozano’s picture

subscribe

Pedro Lozano’s picture

Status: Active » Needs review
StatusFileSize
new3.24 KB

Just playing the Bug Bingo! :)

Pedro Lozano’s picture

Title: Placing an install profile name foo_bar.profile in /profiles/foo causes fatal installer error » Errors when install profile file and directory name differ

Status: Needs review » Needs work

The last submitted patch failed testing.

Pedro Lozano’s picture

Status: Needs work » Needs review
StatusFileSize
new3.96 KB

Moved a few things around.

Pedro Lozano’s picture

Summary of what this patch does:

* Allows profile file name and directory name to differ and have multiple install profiles in the same directory.
* Provides a functions drupal_get_profile_filepath that given a profile name returns the full filepath. This is used in any place where '/profiles/$profile/...' was hardcoded, so it has been put in common.inc.
* Moved function install_find_profiles from install.php to install.inc so drupal_get_profile_filepath can use it from common.inc.

cburschka’s picture

Title: Errors when install profile file and directory name differ » Allow .profile files in differently-named directories
Category: bug » feature
Status: Needs review » Needs work

This is a very good improvement, as it makes profiles consistent with other addons, which are also allowed to have reside in differently-named folders. But shouldn't it be considered a feature request?

Concerning the patch:

1.) I'm not sure the DRUPAL_ROOT should be prefixed in the drupal_get_profile_filepath() function. It's an absolute path constant that is only used for performance when accessing a file. If you ever had occasion to show the return value of drupal_get_profile_path to a user for some reason, having something like "/homes/.fileserver/myuser/sites/domain.com/drupal/profiles/" etc. in there would be awkward. Long story short, DRUPAL_ROOT should probably be added on the require_once line. This also makes it easy to verify that all require commands in core are using canonical paths.

2.) You use a static caching variable. You may need to use &drupal_static() for these.

sun.core’s picture

Version: 7.x-dev » 8.x-dev
dave reid’s picture