When the block is enabled to subscribe, the user is logged in, and you are currently in the edit profile page for custom fields. When you click submit, an error appears about the SQL.
To fix this, what I did was added a check if the email was empty, then return. Its more of a hack, but it works :)
/**
* Implementation of hook_user()
* Checks whether an email address is subscribed to the newsletter
* when a new user signs up. If so, changes uid from 0 to the new uid
* in sn_subscriptions so that the user's subscription status is known
* when he logs in.
*/
function simplenews_user($op, &$edit, &$account, $category = NULL) {
// added to ensure that the email address is passed, if not, return empty.
if ($edit['mail'] == '') return FALSE;
Comments
Comment #1
DriesK commentedWhich version of Simplenews are you using? Seems to me like a problem from an old version. In the latest release, categories are checked in simplenews_user(), so if you are on a custom profile page, no code should be executed.
Please check whether you are using v 1.1.2.8. If you are, and the problem persists, could you provide more information (fields on custom profile page, custom profile page name, exact SQL error). If you are not, please update.
Comment #2
DriesK commented