From 754bdfe620048fb77dc2672ea23c50dd8869b64f Mon Sep 17 00:00:00 2001
From: xjm <xjm@65776.no-reply.drupal.org>
Date: Sat, 11 Feb 2017 13:23:59 -0600
Subject: [PATCH] Issue #2846782 followup by xjm: Add inline documentation for
 the fix.

---
 core/modules/system/src/Plugin/views/field/BulkForm.php | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/core/modules/system/src/Plugin/views/field/BulkForm.php b/core/modules/system/src/Plugin/views/field/BulkForm.php
index a2cfdd2583de..8e38c2b73262 100644
--- a/core/modules/system/src/Plugin/views/field/BulkForm.php
+++ b/core/modules/system/src/Plugin/views/field/BulkForm.php
@@ -344,7 +344,9 @@ protected function getBulkOptions($filtered = TRUE) {
    */
   public function viewsFormSubmit(&$form, FormStateInterface $form_state) {
     if ($form_state->get('step') == 'views_form_views_form') {
-      // Filter only selected checkboxes.
+      // Filter only selected checkboxes. Use the actual user input rather than
+      // the raw form values array, since the site data may change before the
+      // bulk form is submitted, which can lead to data loss.
       $user_input = $form_state->getUserInput();
       $selected = array_filter($user_input[$this->options['id']]);
       $entities = array();
-- 
GitLab