Problem/Motivation
Discovered at #1538118: Update status does not verify the identity or authenticity of the release history URL...
\Drupal\update\Form\UpdateManagerUpdate::buildForm() is currently doing this:
$last_markup = [
'#theme' => 'update_last_check',
'#last' => $this->state->get('update.last_check', 0),
];
$form['last_check'] = [
'#markup' => \Drupal::service('renderer')->render($last_markup),
];
A) Not properly injected renderer service.
However, more to the point:
B) Pre-rendering this is silly -- the form is a giant render array, already.
Steps to reproduce
Visually inspect core/modules/update/src/Form/UpdateManagerUpdate.php and search for 'renderer'.
Proposed resolution
Don't pre-render, and let $form['last_check'] remain a render array until the form itself is rendered.
Remaining tasks
Do it.
- Reviews / refinements.
- RTBC.
- Commit.
User interface changes
Nope.
API changes
None.
Data model changes
N/A
Release notes snippet
Nope.
Comments
Comment #2
dwwComment #3
dwwComment #5
tedbow@dww good catch. I would RTBC but noticed that 'Last checked" doesn't appear anywhere in
core/modules/update/tests/srcshould assert that this actually gets rendered?(though I am sure this shouldn't break anything)I think if we just add the check to
\Drupal\Tests\update\Functional\UpdateTestBase::standardTests()this should work and be called many places.Comment #6
phenaproximaHow's this, @tedbow?
Comment #7
phenaproximaOops, forgot the interdiff.
Comment #8
tedbowLooks good! Thanks @dww and @phenaproxima!
Comment #9
alexpottCommitted 6a0d497 and pushed to 9.3.x. Thanks!