[documentation] [Documentation bug] Install profiles docs seem outdated/incorrect

RobRoy drupal-docs at drupal.org
Sat Dec 2 22:44:41 UTC 2006


Issue status update for 
http://drupal.org/node/94010
Post a follow up: 
http://drupal.org/project/comments/add/94010

 Project:      Documentation
 Version:      <none>
 Component:    Developer Guide
 Category:     bug reports
 Priority:     normal
 Assigned to:  Anonymous
 Reported by:  RobRoy
 Updated by:   RobRoy
-Status:       active
+Status:       fixed

I updated the docs. Probably needs a once over from somebody else. I
left most of webchick's GJG stuff in there and just did a revamp of the
top. Setting to fixed, mark as active if it needs more love.


Also, I think we should rename profile's hook_install() to
hook_profile_install() for D6. Issue at http://drupal.org/node/101008.




RobRoy



Previous comments:
------------------------------------------------------------------------

Fri, 10 Nov 2006 07:42:16 +0000 : RobRoy

http://drupal.org/node/67921 talks about hook_install_configure and
friends, but I can't seem to find where this hook is triggered. I tried
adding it to my .profile file, but it's not getting called and a search
for 'install_configure' in the code comes up blank.


I want to get this install profile stuff going, and will update the
docs if someone sets me straight.




------------------------------------------------------------------------

Fri, 24 Nov 2006 07:32:21 +0000 : Max Bell

Have begun gathering resources and info to bring the installation
profiles documentation into 2006-2007, I hope to have this done soon but
do not plan to stop working on it for considerably longer.


If you have suggestions/ideas/want to provide feedback, test, what have
you, please join us in http://groups.drupal.org/distributions -- my
intentions are good, and beyond that, I'm not claiming I know what I'm
doing, just that I have a computer, too much free time, and a vested
interest in seeing installation profiles bring new markets to Drupal and
expand on those using the product today.




------------------------------------------------------------------------

Fri, 24 Nov 2006 07:50:16 +0000 : RobRoy

I'm going to post this here instead of at the group, but the following
is a sample education install profile I've begun writing for School
Engine [1] which I'm going to port over to Drupal. 


Since I found out hook_configure isn't in the installer it took a
little different solution to add my own form to the post-install
process. Just thought I'd include this as a mini-example and hope it
helps clarify anything even though it's not really filled out. Webchick
probably has a more filled out example?


<?php
// school_engine_basic.profile

/**
 * Implementation of hook_profile_modules().
 * 
 * Return an array of the modules to be enabled when this profile is installed.
 *
 * @return
 *  An array of modules to be enabled.
 */
function school_engine_basic_profile_modules() {
  // Core modules.
 
$modules = array('block', 'color', 'comment', 'filter', 'help', 'menu', 'node', 'system', 'taxonomy', 'user', 'watchdog',
   
'og', 'og_vocab', 'views', 'views_rss', // School Engine modules.
    'school_engine', // School Engine core modules.
    'devel', // Other modules.
  );

  return $modules;
}

/**
 * Implementation of hook_profile_details().
 * 
 * Return a description of the profile.
 */
function school_engine_basic_profile_details() {
  return array(
    'name' => 'School Engine - Basic',
   
'description' => 'Select this profile to enable some basic School Engine functionality and the default theme.',
  );
}

/**
 * Implementation of hook_install().
 */
function school_engine_basic_install() {
  drupal_goto('school_engine_install_configure');
}
?>


<?php
// school_engine.module
/**
 * Implementation of hook_menu().
 */
function school_engine_menu($may_cache) {
  $items = array();

  if ($may_cache) {
   
$items[] = array('path' => 'school_engine_install_configure', 
      'title' => t('School Engine Configuration'),
      'callback' => 'drupal_get_form', 
     
'callback arguments' => array('school_engine_install_form'),
      'access' => TRUE, 
      'type' => MENU_CALLBACK,
    );
  }
  return $items;
}

/**
 * FAPI callback; generate install form.
 */
function school_engine_install_form() {
  $form = array();
  
  $form['include_sample_data'] = array(
    '#type' => 'checkbox',
    '#title' => t('Include sample data'),
  );
  $form['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Submit'),
  );
  return $form;
}

/**
 * FAPI callback; validation for install form.
 */
function school_engine_install_form_validate($form_id, $form_values) {
  // Validate here.
}

/**
 * FAPI callback; submit for install form.
 */
function school_engine_install_form_submit($form_id, $form_values) {
  if ($form_values['include_sample_data']) {
    _school_engine_install_sample_data();
  }
}

/**
 * Helper function to install sample data.
 */
function _school_engine_install_sample_data() {
  // Create sample taxonomy vocabularies and terms.
  $form_values = array(
    'name' => t('Course categories'),
    'nodes' => array('page' => 'page'),
    'multiple' => TRUE,
  );
  drupal_execute('taxonomy_form_vocabulary', $form_values);

  // Create sample groups and test posts.
  $form_values = array(
    'title' => t('Test course'),
    'body' => t('Test course description'),
  );
  $node = new StdClass();
  $node->type = 'group';
  drupal_execute('node_form', $form_values, $node);
}
?>
[1] http://www.schoolengine.com




------------------------------------------------------------------------

Fri, 24 Nov 2006 07:55:21 +0000 : RobRoy

Webchick, I'm on the docs team but can't edit that installer page as
it's unpublished. Can you publish it again or give me rights so I/we can
help edit it?




------------------------------------------------------------------------

Fri, 24 Nov 2006 14:49:20 +0000 : webchick

Republished with huge disclaimer. ;)




------------------------------------------------------------------------

Fri, 24 Nov 2006 16:08:26 +0000 : greggles

subscribing




------------------------------------------------------------------------

Sat, 25 Nov 2006 05:22:18 +0000 : Max Bell

*Blanches*


Okay, Rob -- you are WAY ahead of me on this and it's clear I should be
helping you. I unassigned myself but plan to keep working through this
just the same -- the only way I'll get up on you at this stage is if you
never write the docs, though. ;)




------------------------------------------------------------------------

Sat, 25 Nov 2006 06:28:37 +0000 : RobRoy

Heh, I know a little bit. Next week, I'll update the docs to try and
help get people up-to-speed writing basic install profiles.




------------------------------------------------------------------------

Sat, 25 Nov 2006 12:29:16 +0000 : bonobo

subscribing






More information about the documentation mailing list