Skip to content
Snippets Groups Projects
Commit f46e6626 authored by Dries Buytaert's avatar Dries Buytaert
Browse files

- Patch #440876 by Dave Reid, sun: reuse comment.module's anonymous cookie information.

parent bac6eed5
No related branches found
No related tags found
No related merge requests found
......@@ -1645,7 +1645,7 @@ function comment_form($form, &$form_state, $comment) {
if (!$user->uid && variable_get('comment_anonymous_' . $node->type, COMMENT_ANONYMOUS_MAYNOT_CONTACT) != COMMENT_ANONYMOUS_MAYNOT_CONTACT) {
$form['#attached']['library'][] = array('system', 'cookie');
$form['#attached']['js'][] = drupal_get_path('module', 'comment') . '/comment.js';
$form['#attributes']['class'][] = 'user-info-from-cookie';
}
$comment = (array) $comment;
......
......@@ -50,7 +50,7 @@ function contact_site_form($form, &$form_state) {
if (!$user->uid) {
$form['#attached']['library'][] = array('system', 'cookie');
$form['#attached']['js'][] = drupal_get_path('module', 'contact') . '/contact.js';
$form['#attributes']['class'][] = 'user-info-from-cookie';
}
$form['#token'] = $user->uid ? $user->name . $user->mail : '';
......@@ -178,7 +178,7 @@ function contact_personal_form($form, &$form_state, stdClass $recipient) {
if (!$user->uid) {
$form['#attached']['library'][] = array('system', 'cookie');
$form['#attached']['js'][] = drupal_get_path('module', 'contact') . '/contact.js';
$form['#attributes']['class'][] = 'user-info-from-cookie';
}
$form['#token'] = $user->uid ? $user->name . $user->mail : '';
......
......@@ -3068,6 +3068,9 @@ function user_register_form($form, &$form_state) {
$form['#user'] = drupal_anonymous_user();
$form['#user_category'] = 'register';
$form['#attached']['library'][] = array('system', 'cookie');
$form['#attributes']['class'][] = 'user-info-from-cookie';
// Start with the default user account fields.
user_account_form($form, $form_state);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment