public function viewsForm(&
$form, FormStateInterface
$form_state) { // Make sure we do not accidentally cache this form.
// @todo Evaluate this again in https://www.drupal.org/node/2503009.
$form['#cache'
]['max-age'
] = 0;
// Add the tableselect javascript.
$form['#attached'
]['library'
][] = 'core/drupal.tableselect';
$use_revision =
array_key_exists('revision',
$this->view->
getQuery()->
getEntityTableInfo());
// Only add the bulk form options and buttons if there are results.
if (!
empty($this->view->result
)) { // Render checkboxes for all rows.
$form[$this->options
['id'
]]['#tree'
] = TRUE;
foreach ($this->view->result
as $row_index =>
$row) { $entity =
$this->
getEntity($row);
if ($entity !== NULL
) { $entity =
$this->
getEntityTranslationByRelationship($entity,
$row);
$form[$this->options
['id'
]][$row_index] =
[