Hello,

I've looked at the 4.6-4.7 module upgrade docs at http://drupal.org/node/22218 but didn't find anything useful on this. I have a module that used to add some custom data to the end of user profiles.

define (MARLBORO_PROFILES_LIST_TITLE, 'Marlboro Profile');
define (MARLBORO_PROFILES_RECENT_ITEMS_NUM, 10);

function marlboro_profiles_user ($op, &$edit, &$user, &$category = NULL) {
        switch ($op) {
                case 'view':
                        return marlboro_profiles_user_view ($user);
                        break;
        }
}

function marlboro_profiles_user_view(&$user) {
        $attrs = array('displayname' => 'full name', 'mail' => 'email address', 'edumarlborostatus' => 'status', 'edumarlboroclass' => 'class standing',
                        'telephonenumber' => 'phone', 'edumarlborocampusbox' => 'box'
                        );
        $ret[MARLBORO_PROFILES_LIST_TITLE] = theme ('marlboro_profiles_attribute', $attrs, $user);
        return $ret;
}

If I replace the last two lines of ..._user_view with a "print (theme(...))" call, all the data is printed correctly, but at the top of the page, so I know the data is being retrieved. I'm getting this error in the logs

Invalid argument supplied for foreach() in /var/www/drupal-4.7.0/modules/user.module on line 1453.

I just can't figure out what structure user.module is expecting for the data. I hardly understand the Drupal API, I'm just hacking together this and that, so my debugging skills are limited.

Thanks for any help you can offer.

Comments

heisters’s picture

<bump> anyone?

samo’s picture

Here is what it looks like to me:

$ret = array();
$ret['Category Heading'][] = array('title' => 'Attribute Title', 'value' => 'Attribute Value', 'class' => 'Attribute CSS Class');
$ret['Category Heading'][] = array('title' => 'Attribute Title2', 'value' => 'Attribute Value2', 'class' => 'Attribute CSS Class2');

heisters’s picture

Cool, thanks. I should have thought of doing a little var_dumping in user.module.