I am a Permanent Member (or Community Ambassador) of the Drupal Association.Use these two SQL commands to repair your Drupal 6 site to restore the anonymous user database record:
INSERT INTO users (name, mail) VALUES ('', '');
UPDATE users SET uid=0 WHERE name='';The symptoms you'll see that tip you off that this is needed:
SELECT * FROM users WHERE uid=0; returns zero rows.For the HelpInject module I needed a multi-step form. This is pretty easy in Drupal 6. The problem I encountered was that the “destination” parameter was no longer being honored, and the form was submitting to itself after the last step. It was supposed to be redirecting to “destination”. Here’s the code that made it work. The tip is to unset $form_state['storage'] after you’re done with it because for some reason that’s FAPI’s litmus test for whether or not to redirect.
<?php
// The form is built like this
function foobar_form(&$form_state, $type) {
if (empty($form_state['storage']['foo'])) { } else { }
}
// The submit handler follows a similar pattern.
function foobar_form_submit($form, &$form_state) {
if (empty($form_state['storage']['foo'])) {
$form_state['storage']['foo'] = $form_state['values']['foo'];
$form_state['rebuild'] = TRUE;
} else {
... do CRUD ...
// if you want your form to respect destination,
// unset the storage.
unset($form_state['storage']);
}
}
?>