I was getting a WSOD when trying to install COD, and after I inspected the logs, I found this nugget:

PHP Fatal error: Cannot redeclare system_form_install_select_profile_form_alter() (previously declared in /srv/www/drupal6/profiles/cod/cod.profile:244) in /srv/www/drupal6/profiles/openatrium/openatrium.profile on line 352

It is evident that the openatrium and cod install profiles cannot coexist peacefully :(

Comments

ezra-g’s picture

Title: PHP Fatal error: Cannot redeclare system_form_install_select_profile_form_alter() on multisite » Check for other implementations of system_form_install_select_profile_form_alter()
Priority: Major » Normal

This function is also defined by other distributions in their install profiles, such as OpenPublish. eg: http://api.acquia.com/api/openpublish/profiles--openpublish--openpublish...

The courteous thing for COD to do would be to check whether this function has already been defined, and only define it if it is not. Patches welcome :).

In the meantime, you can safely comment out this code and manually select the desired install profile, or download the COD_Support modules.

greggles’s picture

Another solution would be to choose a different core module to abuse and define the function for that module. User maybe?

develcuy’s picture

Confirmed. To fix just add a function_exists before function declaration:

file: profiles/cod/cod.profile

if (!function_exists('system_form_install_select_profile_form_alter')) {
  function system_form_install_select_profile_form_alter(&$form, $form_state) {
    foreach ($form['profile'] as $key => $element) {
      $form['profile'][$key]['#value'] = 'cod';
    }
  }
}
greggles’s picture

Yeah, I'm starting to think the best practice here is to have an array of candidate names for this function based on core required modules. Then you loop the array and try one until it doesn't exist and you can declare it...

greggles’s picture

Status: Active » Needs review
StatusFileSize
new949 bytes

I think this should do it. I didn't find any evidence of a user version of this function...

That said, I'm tempted to "won't fix" this if it is more complex than this change. Just because the focus for 6.x is on getting it out the door as a 1.0 and this seems like a low priority item.

greggles’s picture

Issue tags: +COD 6.x-1.0 radar
StatusFileSize
new1.14 KB

So, I actually tested this and found that you need to either override the filter or system modules because those are the only two that exist at this point.

This seems like it should go in to 6.x-1.0 to me, so tagging.

greggles’s picture

StatusFileSize
new1.14 KB

Now with 100% less copy-paste error.

greggles’s picture

StatusFileSize
new1.13 KB
ezra-g’s picture

Status: Needs review » Needs work

Thanks - #8 doesn't apply, possibly because of http://drupalcode.org/project/cod.git/commit/4ce4eba.

greggles’s picture

Status: Needs work » Needs review
StatusFileSize
new1.37 KB

re-roll + docs.

ezra-g’s picture

Status: Needs review » Fixed

#10 properly sets the default installation profile to COD on a fresh install. Committed - Thanks!

http://drupalcode.org/project/cod.git/commit/c02d7e3

Automatically closed -- issue fixed for 2 weeks with no activity.