You are here

protected function UpdateManagerUpdate::removeCheckboxFromRow in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/update/src/Form/UpdateManagerUpdate.php \Drupal\update\Form\UpdateManagerUpdate::removeCheckboxFromRow()
  2. 9 core/modules/update/src/Form/UpdateManagerUpdate.php \Drupal\update\Form\UpdateManagerUpdate::removeCheckboxFromRow()

Prepares a row entry for use in a regular table, not a 'tableselect'.

There are no checkboxes in the 'Manual updates' or 'Not compatible' tables, so they will be rendered by '#theme' => 'table', not 'tableselect'. Since the data formats are incompatible, this method converts to the format expected by '#theme' => 'table'. Generally, rows end up in the main tables that have a checkbox to allow the site admin to select which missing updates to install. This method is only used for the special case tables that have no such checkbox.

@todo In https://www.drupal.org/project/drupal/issues/3121775 refactor self::buildForm() so that we don't need this method at all.

Parameters

array[] $row: The render array for a table row.

1 call to UpdateManagerUpdate::removeCheckboxFromRow()
UpdateManagerUpdate::buildForm in core/modules/update/src/Form/UpdateManagerUpdate.php
Form constructor.

File

core/modules/update/src/Form/UpdateManagerUpdate.php, line 346

Class

UpdateManagerUpdate
Configure update settings for this site.

Namespace

Drupal\update\Form

Code

protected function removeCheckboxFromRow(array &$row) {
  unset($row['#weight']);
  $attributes = $row['#attributes'];
  unset($row['#attributes']);
  $row = [
    'data' => $row,
  ] + $attributes;
}