Problem/Motivation
Steps to "reproduce":
Add a custom basic block
Place the block in a region and save
Select to delete the block from the custom block library
UI text = This will also remove 1 placed block instance.This action cannot be undone.
Proposed resolution
Add a space between the two UI text sentences
Remaining tasks
Patch. Review. Commit.
| Comment | File | Size | Author |
|---|---|---|---|
| #12 | 2989657-12.patch | 1.19 KB | Vidushi Mehta |
| #7 | interdiff-2989657-2-7.txt | 1.23 KB | tetranz |
| #7 | add-a-space-2989657-7.patch | 1.23 KB | tetranz |
| #2 | add-a-space-2989657-2.patch | 867 bytes | tetranz |
Comments
Comment #2
tetranz commentedThis seems like a simplistic way to do it but I don't see a better way. We have two #markup elements rendered next to each other.
Comment #3
chris matthews commentedadd-a-space-2989657-2.patch seems like an ok fix to me, but leaving the status as Needs review in case someone else would like to chime in before the status is changed to RTBC.
Comment #4
gchauhan commentedHi @tetranz, Thanks for the patch. Your patch applied successfully. This patch will add the space between two sentences at the custom basic block delete page.
Comment #5
longwaveI think adding the trailing space here will make translations more difficult, as they will also need to include the space.
It might be better to override getDescription() instead of buildForm() and add the message there. See e.g. MenuDeleteForm or ImageStyleDeleteForm which have similar logic in their getDescription() methods.
Comment #6
tetranz commentedThanks @longwave. I had a feeling that wasn't the right way to go. I'll look at that in the next few days if nobody else does.
Comment #7
tetranz commentedThis should be a little better.
I've done it slightly different to those other examples to avoid string concatenation and an unnecessary paragraph when there are no placed instances.
Comment #8
longwaveWorks as described.
Comment #10
longwaveUnrelated fail.
Comment #11
alexpottCombining strings like this doesn't work for translating. Sentence order can be complex.
I think we have a couple of possibilities here:
Move the
$this->formatPlural(count($instances), 'This will also remove 1 placed block instance.', 'This will also remove @count placed block instances.')into a proper Drupal message ie do:Or we could do something like
Comment #12
Vidushi Mehta commentedAdded a patch with the above mentioned change by #11.
Comment #13
longwaveWe weren't really combining strings, they were two separate paragraphs and we do the same elsewhere (albeit not with sprintf). Still, #12 is functionally identical so RTBC.
Comment #14
alexpott@longwave hmmm good point but I think this is the correct change because the description for the delete form is changing depending on whether additional things are going to be deleted so it makes sense to me.
Committed c0ab589 and pushed to 8.7.x. Thanks!
Fixed unused use on commit.
The file mode shouldn't be changed by this patch. Fixed on commit.