If a user is created programmatically, with an invalid email address or a similar problem (eg. if the email is blank, isn't in the correct format, or duplicates another email address in the database) then the user cannot be deleted.

On the user edit page 'user/{uid}/edit', if you click the delete button the form attempts to validate before it will let you delete the user. So any email address problems or invalid characters in the user name will cause the form API to insist that you correct it. The form should not validate data you are asking it to delete IMHO.

Yes, I know creating users with invalid data is not the best practice, but there are some testing instances where this can be useful, or it can even happen accidentally during development. For example, if an administrator wanted to create multiple accounts under different roles he/she must enter a unique email address for each user, this can be done programmatically but you cannot delete the user from the user/{uid}/edit page.

Is it possible to make the form API bypass validation when you are deleting a record? Is this the same behavior with node forms?

I'd offer a patch, but the 6.x form API is still pretty new to me.

Cheers and thanks.

Comments

perforator’s picture

Version: 6.2 » 6.3
Component: user system » node.module
Status: Active » Closed (duplicate)

Hi.

Marked as duplicate of Click!.