diff --git a/core/misc/form.js b/core/misc/form.js index 9bb9379..2437184 100644 --- a/core/misc/form.js +++ b/core/misc/form.js @@ -190,24 +190,4 @@ Drupal.behaviors.formUpdated = { } }; -/** - * Prepopulate form fields with information from the visitor cookie. - */ -Drupal.behaviors.fillUserInfoFromCookie = { - attach: function (context, settings) { - var userInfo = ['name', 'mail', 'homepage']; - $('form.user-info-from-cookie').once('user-info-from-cookie', function () { - var $formContext = $(this); - var i, il, $element, cookie; - for (i = 0, il = userInfo.length; i < il; i += 1) { - $element = $formContext.find('[name=' + userInfo[i] + ']'); - cookie = $.cookie('Drupal.visitor.' + userInfo[i]); - if ($element.length && cookie) { - $element.val(cookie); - } - } - }); - } -}; - })(jQuery, Drupal, Drupal.debounce); diff --git a/core/modules/comment/lib/Drupal/comment/CommentFormController.php b/core/modules/comment/lib/Drupal/comment/CommentFormController.php index c5afeeb..dd8a993 100644 --- a/core/modules/comment/lib/Drupal/comment/CommentFormController.php +++ b/core/modules/comment/lib/Drupal/comment/CommentFormController.php @@ -89,11 +89,6 @@ public function form(array $form, array &$form_state) { $anonymous_contact = $instance->getSetting('anonymous'); $is_admin = $comment->id() && $this->currentUser->hasPermission('administer comments'); - if (!$this->currentUser->isAuthenticated() && $anonymous_contact != COMMENT_ANONYMOUS_MAYNOT_CONTACT) { - $form['#attached']['library'][] = array('system', 'jquery.cookie'); - $form['#attributes']['class'][] = 'user-info-from-cookie'; - } - // If not replying to a comment, use our dedicated page callback for new // Comments on entities. if (!$comment->id() && empty($comment->pid->target_id)) { @@ -371,10 +366,6 @@ public function save(array $form, array &$form_state) { $uri = $entity->uri(); if ($this->currentUser->hasPermission('post comments') && ($this->currentUser->hasPermission('administer comments') || $entity->{$field_name}->status == COMMENT_OPEN)) { - // Save the anonymous user information to a cookie for reuse. - if ($this->currentUser->isAnonymous()) { - user_cookie_save(array_intersect_key($form_state['values'], array_flip(array('name', 'mail', 'homepage')))); - } $comment->save(); $form_state['values']['cid'] = $comment->id(); diff --git a/core/modules/contact/lib/Drupal/contact/MessageFormController.php b/core/modules/contact/lib/Drupal/contact/MessageFormController.php index ca4a607..6c62359 100644 --- a/core/modules/contact/lib/Drupal/contact/MessageFormController.php +++ b/core/modules/contact/lib/Drupal/contact/MessageFormController.php @@ -44,13 +44,9 @@ public function form(array $form, array &$form_state) { '#title' => t('Your e-mail address'), '#required' => TRUE, ); - if ($user->isAnonymous()) { - $form['#attached']['library'][] = array('system', 'jquery.cookie'); - $form['#attributes']['class'][] = 'user-info-from-cookie'; - } // Do not allow authenticated users to alter the name or e-mail values to // prevent the impersonation of other users. - else { + if (!$user->isAnonymous()) { $form['name']['#type'] = 'item'; $form['name']['#value'] = $user->getUsername(); $form['name']['#required'] = FALSE; @@ -142,8 +138,6 @@ public function save(array $form, array &$form_state) { // take over the submitted form values. $sender->name = $message->getSenderName(); $sender->mail = $message->getSenderMail(); - // Save the anonymous user information to a cookie for reuse. - user_cookie_save(array('name' => $message->getSenderName(), 'mail' => $message->getSenderMail())); // For the e-mail message, clarify that the sender name is not verified; it // could potentially clash with a username on this site. $sender->name = t('!name (not verified)', array('!name' => $message->getSenderName())); diff --git a/core/modules/system/system.module b/core/modules/system/system.module index cb0cb54..89da0d1 100644 --- a/core/modules/system/system.module +++ b/core/modules/system/system.module @@ -975,7 +975,6 @@ function system_library_info() { array('system', 'jquery'), array('system', 'drupal'), array('system', 'drupal.debounce'), - array('system', 'jquery.cookie'), array('system', 'jquery.once'), ), ); @@ -1201,19 +1200,6 @@ function system_library_info() { ), ); - // jQuery BBQ plugin. - $libraries['jquery.bbq'] = array( - 'title' => 'jQuery BBQ', - 'website' => 'http://benalman.com/projects/jquery-bbq-plugin/', - 'version' => '1.3pre', - 'js' => array( - 'core/assets/vendor/jquery-bbq/jquery.ba-bbq.js' => array(), - ), - 'dependencies' => array( - array('system', 'jquery'), - ), - ); - // Dropbutton. $libraries['drupal.dropbutton'] = array( 'title' => 'Dropbutton', diff --git a/core/modules/tour/tour.module b/core/modules/tour/tour.module index 16fe5f0..154696c 100644 --- a/core/modules/tour/tour.module +++ b/core/modules/tour/tour.module @@ -60,7 +60,6 @@ function tour_library_info() { ), 'dependencies' => array( array('system', 'jquery'), - array('system', 'jquery.cookie'), ), ); diff --git a/core/modules/user/lib/Drupal/user/RegisterFormController.php b/core/modules/user/lib/Drupal/user/RegisterFormController.php index d1e7e71..09f351f 100644 --- a/core/modules/user/lib/Drupal/user/RegisterFormController.php +++ b/core/modules/user/lib/Drupal/user/RegisterFormController.php @@ -44,9 +44,6 @@ public function form(array $form, array &$form_state) { return new RedirectResponse(url('user/' . $user->id(), array('absolute' => TRUE))); } - $form['#attached']['library'][] = array('system', 'jquery.cookie'); - $form['#attributes']['class'][] = 'user-info-from-cookie'; - // Start with the default user account fields. $form = parent::form($form, $form_state, $account); diff --git a/core/modules/user/user.module b/core/modules/user/user.module index 235d8fd..00e1511 100644 --- a/core/modules/user/user.module +++ b/core/modules/user/user.module @@ -1766,29 +1766,6 @@ function user_modules_uninstalled($modules) { } /** - * Saves visitor information as a cookie so it can be reused. - * - * @param $values - * An array of key/value pairs to be saved into a cookie. - */ -function user_cookie_save(array $values) { - foreach ($values as $field => $value) { - // Set cookie for 365 days. - setrawcookie('Drupal.visitor.' . $field, rawurlencode($value), REQUEST_TIME + 31536000, '/'); - } -} - -/** - * Delete a visitor information cookie. - * - * @param $cookie_name - * A cookie name such as 'homepage'. - */ -function user_cookie_delete($cookie_name) { - setrawcookie('Drupal.visitor.' . $cookie_name, '', REQUEST_TIME - 3600, '/'); -} - -/** * Implements hook_file_download_access(). */ function user_file_download_access($field, EntityInterface $entity, File $file) {