I've been developing a module for a project that is based on a modified version of the core user management code. So far I've been able to get the module working as I want it with little trouble. Today, however, I copied a chunk of code out of this module and into a new module to work off of. As soon as I did this, the theme override function on the first module stopped working and is now no longer processed at all. I've tried disabling/enabling my original module, disabling/deleting the new module, renaming functions, etc. It seems that no matter what I do the theme override function refuses to work.

Theme override code:

<?php
function theme_wwguser_front($form) {
   
$rows = array();
   
   
$header = array(
       
theme('table_select_header_cell'),
        array(
'data' => t('Username'), 'field' => 'u.name', 'sort' => 'asc'),
        array(
'data' => t('Company Name'), 'field' => 'u.company'),
        array(
'data' => t('Status'), 'field' => 'u.status'),
       
t('Operations')
        );
   
   
$output = drupal_render($form['options']);

   
$rows = array();
    foreach (
element_children($form) as $key) {
       
$row = array();
        if (isset(
$form[$key]['uname'])) {
           
$row[] = drupal_render($form['featured'][$key]);
           
$row[] = drupal_render($form[$key]['uname']);
           
$row[] = drupal_render($form[$key]['ucompany']);
           
$row[] = drupal_render($form[$key]['ustatus']);
           
$row[] = drupal_render($form[$key]['ops']);
           
$rows[] = $row;
        }
    }
   
$output .= theme('table', $header, $rows);

   
$output .= drupal_render($form);
    return
$output;
}
?>

Function that it is working off of.

<?php
function wwguser_front(){

   
$header = array(
        array(),
        array(
'data' => t('User Name'), 'field' => 'u.name', 'sort' => 'asc'),
        array(
'data' => t('Company Name'), 'field' => 'u.company'),
        array(
'data' => t('Status'), 'field' => 'u.status'),
       
t('Operations')
        );
       
   
$query = "SELECT * from {users} u WHERE u.uid != 0";
   
$query .= tablesort_sql($header);
   
$rs = db_query($query);
   
   
$form['options'] = array(
       
'#type' => 'fieldset',
       
'#title' => t('Update options'),
       
'#prefix' => '<div class="container-inline">',
       
'#suffix' => '</div>',
    );
   
   
$options = array();
        foreach (
module_invoke_all('user_operations') as $operation => $array) {
        if(
$array['label']=='Unblock the selected users' || $array['label']=='Block the selected users')$options[$operation] = $array['label'];
    }

   
   
$form['options']['operation'] = array(
       
'#type' => 'select',
       
'#options' => $options,
       
'#default_value' => 'unblock',
    );
   
   
$form['options']['submit'] = array(
       
'#type' => 'submit',
       
'#value' => t('Update'),
    );
   
    if (
$rs) {
        while (
$data = db_fetch_object($rs)) {
            if (
$data->status==0)$ustatus='Disabled';else $ustatus='Enabled';
           
$chks[$data->uid] = "";
           
$form[$data->uid]['uname'] = array('#value' => stripslashes($data->name));
           
$form[$data->uid]['ucompany'] = array('#value' => stripslashes($data->company));
           
$form[$data->uid]['ustatus'] = array('#value' => $ustatus);
           
$form[$data->uid]['ops'] = array('#value' => l('edit','admin/settings/wwguser',array('query' => 'editID='.$data->uid.'&editName='.$data->name)));
        }
    }

   
$form['featured'] = array(
       
'#type' => 'checkboxes',
       
'#options' => $chks,
    );



    return
$form;
}
?>

That function is called from here:

<?php
function wwguser_menu() {

 
$items = array();

 
$items['admin/settings/wwguser'] = array(
   
'title' => 'WWG User Management',
   
'description' => 'Edit/Disable/Enable Users',
   
'page callback' => 'drupal_get_form',
   
'page arguments' => array('wwguser_front'),
   
'access arguments' => array('access administration pages'),
   
'type' => MENU_NORMAL_ITEM,
   );

  return
$items;
}
?>

Comments

Have you registered this

Have you registered this theme in hook_theme()?

Full-time freelancer, always looking for work.
jaypan.com (my portfolio)

No, I didn't realize I needed

No, I didn't realize I needed to (this is my first Drupal project). I'll check it out. If you could point me towards any tutorials or docs that would help, I'd appreciate it.

Thanks.

I don't have any tutorials in

I don't have any tutorials in particular, but look up hook_theme(), also do some reading in the theme developers handbook.

For a bit of background, theme functions need to be registered to the theme directory before Drupal will use them. This directory is cached, so if you make any changes, you will need to refresh the cache before those changes can be seen. Theme functions should reside in the same file as hook_theme().

Good luck!

Full-time freelancer, always looking for work.
jaypan.com (my portfolio)

_

Looks like that's the problem; there's no wguser_theme - see http://api.drupal.org/api/function/hook_theme/6

Pete.

Thanks for the info - I'll

Thanks for the info - I'll check it out the links provided.

Got it working - thanks for

Got it working - thanks for the help.