Refactor UpdateManagerUpdateForm::buildForm() to make ::removeCheckboxFromRow() unnecessary

Created on 23 March 2020, about 5 years ago
Updated 14 May 2025, 18 days ago

Problem/Motivation

Follow-up to address #3113992-79: The 'Update' page has no idea that some updates are incompatible β†’ (point 3).

In that issue, we're adding a private helper method, UpdateManagerUpdateForm::removeCheckboxFromRow()

That was a compromise to avoid some code duplication and make things easier to read, while trying not to explode the scope of that critical bugfix for a wider refactoring. However, as we now have 3 possible tables on that form, and only one of them needs checkboxes, we should refactor how this all works.

Proposed resolution

Instead of building up $entry as if it needs a checkbox from the start, the buildForm() method should use a more simple data structure as the bulk of that method runs to store the stuff we always care about (project name, currently installed version, recommended update, etc). Then, once we know what table the entry belongs in, we should have a helper method that converts it into a row that's appropriate for either '#theme' => 'table' or 'tableselect' as appropriate.

πŸ“Œ Make the table of incompatible releases in UpdateManagerUpdateForm more theme-friendly Closed: outdated is related to this, since that issue might introduce an entirely different twig template for the 'Not compatible' table, so the helper method might need to do something different to generate rows for that table, too.

Remaining tasks

  1. Decide exactly how we want this to all work.
  2. Implement it.
  3. Ensure we didn't break anything.
  4. Reviews/improvements.
  5. RTBC.
  6. Commit.

User interface changes

None.

API changes

Nothing public. Only changes to private or protected methods..

Data model changes

None.

Release notes snippet

N/A.

πŸ“Œ Task
Status

Closed: won't fix

Version

11.0 πŸ”₯

Component

update.module

Created by

πŸ‡ΊπŸ‡ΈUnited States dww

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024