Problem/Motivation
While taking a look at the current merge request for #3284936: Improve messaging to users to backup database I've noticed that the error message for the readiness checks lists the failed checks indented with bullet points:

that way it is fairly easy for the user to distinguish the different calls to action.
In contrast the warning message on the ready to update page doesn't have any ident or bullet points at all for the modules in question. In case only skimming the user might get under the impression the word belongs to the sentence before due to a line wrap. the user has to read more carefully.

If the styling would be like the readiness checks the user would only have to skim " Possible database updates"...."following extension" and then jump to the bullet point list or read everything if it is the first update with a required database update.
Proposed resolution
- prefix each module in the list with indent and a bullet point
| Comment | File | Size | Author |
|---|---|---|---|
| #13 | composer_patches.png | 149.62 KB | rkoller |
| ready_to_update_warning.png | 216.48 KB | rkoller | |
| readiness_error.png | 121.8 KB | rkoller |
Issue fork automatic_updates-3303113
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
phenaproximaYup, we can do this. Here's one way:
Right now, in UpdateReady::buildForm(), we have this code:
We're setting each pending update as its own message. Instead, we should render them as an item list. The item list's
#prefixshould be the existing warning text ("Possible database updates were detected...") and the list's#itemsshould be the names of the extensions with updates (i.e.,'#items' => $pending_updates).We'll need to inject the
rendererservice into the form and render the item list (userenderRoot()), then add that rendered list to $messages. We won't have to worry about backwards compatibility when injecting the renderer, since the form is bothfinaland explicitly internal.I think that would have the desired result, and we could (and should) easily adjust our test coverage to make sure we're rendering the expected HTML.
Comment #4
rahul_ commentedComment #5
rkollerI had a quick discussion with @phenaproxima on Slack yesterday and we agreed that i forward the information into this issue even though it might be out of scope but at least as reference for a potential follow up issue. Initially i've asked three questions:
Q 1: are there any cases if a database update is needed that the user isn’t forwarded to the database update page?
A 1: :thinking_face: I don’t think so…the validator is detecting potential changes in the staged files, so it will forward you. If nothing is needed, the update page will just say nothing is needed. (I think.)
Q 2: what are “extensions”?
A 2: Blanket term for “modules and themes”. We could maybe rephrase it to “modules or themes”, since we cannot tell, at that stage, which ones are which.
Q 3: ...and might there be an item in the list returned that has to be fixed outside the database update page manually?
A 3: Extremely unlikely. I never heard of something like that.
Based on his answer i came up with the following feedback:
i wonder if the sentence should be rephrased then?
remove
you may be redirected, remove the divide by the semicolon and create shorter sentences?and one nitpick currently there is the reference to the list of modules in question in the first half of the sentence then in the second half the explanation what will happen after (so there is a disconnect between the sentence referring to the list and the list itself). if there are three shorter sentences it might be easier to digest. something like in the first sentence just state that database updates are necessary. in the second sentence that the user will be redirected to the database update page. and in the third sentence the reference to the list of modules and themes.
Necessary database updates were detected. In the next step you will be redirected to the database update page in order to complete the update process. The following themes and modules need updates:Comment #7
rahul_ commentedI updated code and created MR.
Comment #8
phenaproximaThis is a great start, but there are a few things I don't understand, and a couple of things we could adjust.
Also, we'll need automated test coverage. We have existing coverage of this message in UpdaterFormTest, but we'll want to modify it so that we're also asserting that the listed extensions are actually shown as items in an unordered list.
Comment #9
rkollerwhile i was typing my reply @phenaproxima already posted feedback. only from my end one additional observation reposted. I've tried to apply the patch to the latest dev version of automatic updates on a drupal 9.4.2 install. but unfortunately composer-patches was unable to apply the patch.
Comment #10
rahul_ commentedI fixed the MR improvements suggestions, could you please re-review.
Thanks.
Comment #11
rkollerhmmm i had set the diff file to
patches-ignorefor the time @rahul_ was working on the changes. i've moved it back to thepatchessection in my projectscomposer.json.but somehow oncomposer update drupal/automatic_updates -wthe patch still fails to apply :/ setting it back to needs work.Comment #12
phenaproxima@rkoller, are you applying the patch against a tagged release of Automatic Updates, or against HEAD of 8.x-2.x? I suspect that only the latter will work since this module is changing so rapidly.
composer require drupal/automatic_updates:2.x-dev
Comment #13
rkollerwhen applying patches i only use the dev release. i've even set the other automatic updates patch to

patches-ignoreto iron out the possibility that the two might overlap. but still the patch from this issue fails to apply.Comment #14
phenaproximaCode looks great. Nice work, @rahul_.
One more small suggestion, and then all this needs is test coverage. I'll take those on, since the test changes are not very obvious.
Comment #15
phenaproximaAdded test coverage.
I think that, once @tedbow thinks this looks good, we should also transfer it into Automatic Updates' UpdateReady form (and the corresponding test) before RTBC.
Comment #16
tedbowComment #17
phenaproximaComment #19
phenaproximaFinally! Nice work everyone. Merged into 8.x-2.x.