I'm trying out the tag user_bundles. Enable the module and navigate to the user/add page. You get the following error:

EntityMalformedException: Missing bundle property on entity of type user. in entity_extract_ids() (line 7389 of /home/diederik/Openbaar/vanilla/includes/common.inc).

I saw another issue like this, but it referred to the 7.x-2.x branch, which I cannot find in the repository.

Comments

yakoub’s picture

Assigned: Unassigned » yakoub

i deleted the 7.x-2.x branch and merged it into 7.x-1.x,
so please fetch latest 7.x-1.x branch and test again
by the way there is no user/add , there is admin/people/create

zilverdistel’s picture

Does the (latest) 7.x-1.x branch implement user bundles? Because that's really what I'm interested in.

yakoub’s picture

it doesn't implement user bundles, it creates a new entity that is user_category which in turn has bundles, this is only a technical difference, since you will get same result when you edit user account whether it is a bundle for user entity or bundle for user_category entity .

i did try in the beginning to implement user bundles (and thus the git tag) but the only way to get it to work is to patch drupal_anonymous_user and add the bundle property to the object so that the above error doesn't happen on user creation, but other than this it works fine .

zilverdistel’s picture

Can you attach this patch? I'd be interested to continue research on this. Maybe we should try to get this patch in core, if it's not too drastic ..

yakoub’s picture

i created branch user_alter for further development , which has a recent fix to user_register_form
the change to core is adding the line

$user->category = 'account';

to the function drupal_anonymous_user


maybe the right way to do this is drupal_alter :

function drupal_anonymous_user() {
 ...
 ...
 drupal_alter('anonymous_user', $user);
 return $user;
}

and then implement the hook :

function user_categories_anonymous_user_alter($user) {
  $user->category = 'account';
}
yakoub’s picture

Version: » 7.x-1.x-dev
Status: Active » Closed (works as designed)