Issue #2846782 followup by xjm: Add inline documentation for the fix.

8.4.x
xjm 2017-02-11 13:23:59 -06:00
parent d35eacbd57
commit 754bdfe620
1 changed files with 3 additions and 1 deletions

View File

@ -344,7 +344,9 @@ class BulkForm extends FieldPluginBase implements CacheableDependencyInterface {
*/ */
public function viewsFormSubmit(&$form, FormStateInterface $form_state) { public function viewsFormSubmit(&$form, FormStateInterface $form_state) {
if ($form_state->get('step') == 'views_form_views_form') { 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(); $user_input = $form_state->getUserInput();
$selected = array_filter($user_input[$this->options['id']]); $selected = array_filter($user_input[$this->options['id']]);
$entities = array(); $entities = array();