disable the admin menu and move to admin_menu, activate blocks

anarcat - June 4, 2009 - 21:17
Project:Hostmaster
Version:6.x-0.2-beta1
Component:Code
Category:task
Priority:critical
Assigned:Unassigned
Status:closed
Issue tags:aegir-0.2
Description

16:54 <@Vertice> and also we need to do the menu / user role stuff of the install profile
17:01 <@Vertice> the install profile only has the bare necessities ported
17:01 <@Vertice> it doesn't do the eldir theme
17:01 <@Vertice> it doesn't do admin menu (and the menu stuff)
17:01 <@Vertice> i'm not even sure it creates the roles
17:02 <@Vertice> in 0.2 we were copying the install_profile_api 1.x functions we needed, since we needed so few of them
17:02 <@Vertice> but for the d6 version, all of those functions changed
17:02 <@Vertice> so i did the port by starting out with install_profile_api, without copying them
17:02 <@Vertice> to see if it's a reasonable dependency to add
17:05 <@Vertice> function hostmaster_profile_final() {
17:05 <@Vertice>   // add default blocks
17:05 <@Vertice>   hostmaster_install_add_block('hosting', 'hosting_summary', 'garland', 1, 10, 'left');
17:05 <@Vertice>   hostmaster_install_add_block('hosting', 'hosting_queues', 'garland', 1, 0, 'right');
17:05 <@Vertice>   hostmaster_install_add_block('hosting', 'hosting_queues_summary', 'garland', 1, 2, 'right');
17:05 <@Vertice>   // enable the eldir theme, if present
17:05 <@Vertice>   hostmaster_setup_theme('eldir');
17:05 <@Vertice>   // Enable optional, yet recommended modules.
17:05 <@Vertice>   hostmaster_setup_optional_modules();
17:05 <@Vertice>   // @todo create proper roles, and set up views to be role based
17:05 <@Vertice>   hostmaster_install_set_permissions(hostmaster_install_get_rid('anonymous user'), array('access content', 'access all views'));
17:05 <@Vertice>   hostmaster_install_set_permissions(hostmaster_install_get_rid('authenticated user'), array('access content', 'access all views'));
17:05 <@Vertice>   hostmaster_install_create_role('aegir client');
17:05 <@Vertice>   // @todo we may need to have a hook here to consider plugins
17:05 <@Vertice>   hostmaster_install_set_permissions(hostmaster_install_get_rid('aegir client'), array('access content', 'access all views', 'edit own client', 'view client', 'create site', 'delete site', 'view site', 'create backup task', 'create delete task', 'create disable task', 'create enable task', 'create restore task', 'view own tasks', 'view task'));
17:05 <@Vertice>   hostmaster_install_create_role('aegir account manager');
17:05 <@Vertice>   hostmaster_install_set_permissions(hostmaster_install_get_rid('aegir account manager'), array('create client', 'edit client users', 'view client'));
17:05 <@Vertice>   menu_rebuild();
17:05 <@Vertice>   node_access_rebuild();
17:06 <@Vertice>   drupal_goto('hosting/wizard');
17:06 <@Vertice> }
17:06 <@Vertice> all of that has not been ported yet
17:06 <@Vertice> all of that was using the functions sourced from install_profile_api
17:06 <@anarcat> so a critical issue should be opened

#1

anarcat - June 9, 2009 - 22:21
Priority:critical» normal

Moving out of the main 0.2 critical queue, we'll retarget once we get 0.2 out. I'm tagging those particular issues with the +aegir-6.x-0.2 tag.

#2

anarcat - June 16, 2009 - 04:23
Version:5.x-0.2.x-dev» 6.x-0.2-beta1
Priority:normal» critical
Issue tags:-aegir-6.x-0.2+aegir-0.2

#3

anarcat - June 16, 2009 - 04:31

#4

anarcat - June 25, 2009 - 03:25
Status:active» fixed

Alright, I rewrote all this to use install_profile_api (which seems to be broken, so we need to use the CVS version, see #501548: please release a 2.1 version for drupal 6). I fixed the install instructions (INSTALL.txt) to tell users to use the CVS version of the install_profile_api module. I also changed the instructions to tell users to install the theme into sites/all/themes otherwise the install wizard doesn't pick it up, for some reason.

There's only one thing in there I don't feel too good about... The original hostmaster_profile_final() call is now a seperate step ("finalize") and it's a bit bizarre to have a mostly empty step (from the user perspective, there's nothing to do) before the last step. I don't know how to work around that because the hook_profile_final() is just gone and the documentation is simply lacking for the upgrade path between 5 and 6 for install profiles.

#5

anarcat - June 25, 2009 - 03:32
Title:D6 wizard: port the hosting_*() functions to install_profile_api and D6» disable the admin menu and move to admin_menu, activate blocks
Status:fixed» needs work

So while some work was done here, it seems that the block manipulation doesn't work. The admin menu also doesn't get torn down properly, which may be an install_profile_api issue.

#6

anarcat - June 25, 2009 - 04:19
Status:needs work» fixed

Okay, I committed another fix for this. I'm not sure install_profile_api is doing the right thing here, I'm testing with this function:

function install_menu_disable_item($mlid, $unhide = FALSE) {
  $status = ($unhide) ? 0 : 1;
  db_query("UPDATE {menu_links} SET hidden = %d WHERE mlid = %d", $status, $mlid);
  menu_rebuild();
}

in install_profile_api/core/menu.inc...

#7

System Message - July 9, 2009 - 04:20
Status:fixed» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.