On /admin/structure/block/block-content page when no custom blocks are available, then the two UI strings touches each other, which is grammatically incorrect. This is because the block_content core module's Views plugin alters the empty listing by concatenating its own plus string in extra. We could provide some separation before this happening.

Comments

Balu Ertl created an issue. See original summary.

baluertl’s picture

Status: Active » Needs review
StatusFileSize
new1009 bytes
shimpy’s picture

StatusFileSize
new9.87 KB
new925 bytes

I have created patch for separating the two UI strings. Please review.

UI

shimpy’s picture

Version: 8.7.x-dev » 8.9.x-dev
shimpy’s picture

StatusFileSize
new925 bytes
new9.87 KB

I have created patch for separating the two UI strings. Please review. Testing with drupal 8.9

UI

huzooka’s picture

@shimpy Could you please provide interdiffs as well?

It's really hard to keep track of the updates without interdiff.

shimpy’s picture

hii @huzooka
The patch in #3 and#5 are same.Only drupal versions are differenet so there is no interdiff i can create..
#2 was failed to apply so I created #5.Please review. Attached the screenshot as well.

UI

dinesh18’s picture

StatusFileSize
new804 bytes
new929 bytes

#5 has 1 white space errors. I have fixed it. Attached Interdiff and patch file

dinesh18’s picture

StatusFileSize
new827 bytes

Ignore patch in #8,
Here is the patch which resolved white space issues.

shimpy’s picture

Status: Needs review » Reviewed & tested by the community

hii @Dinesh
Thanks for correcting the indentation error. Patch #8 is successfully applied and looks good as well.

baluertl’s picture

Thanks for joining @shimpy & @Dinesh, so now #9 is basically a fixed version of my original #2, thanks for correcting! Now I realized I forgot to remove the /Applications/MAMP/htdocs/commerce-test/docroot/core/ part of the paths, this is why the patch did not applied 🤦‍♂️

baluertl’s picture

catch’s picture

Status: Reviewed & tested by the community » Needs work
+++ b/core/modules/block_content/src/Plugin/views/area/ListingEmpty.php
@@ -74,6 +74,7 @@ public function render($empty = FALSE) {
       $element = [
         '#markup' => $this->t('Add a <a href=":url">custom block</a>.', [':url' => Url::fromRoute('block_content.add_page')->toString()]),
+        '#prefix' => ' ',
         '#access' => $access_result->isAllowed(),

This could use a code-comment explaining why it's being added. Also before/after screenshots would be good here.

swatichouhan012’s picture

Assigned: baluertl » swatichouhan012
swatichouhan012’s picture

Assigned: swatichouhan012 » Unassigned
Status: Needs work » Needs review
StatusFileSize
new877 bytes
new736 bytes
new56.32 KB
new56.11 KB

I have created new patch with code-comments and interdiff Kindly review.

Status: Needs review » Needs work

The last submitted patch, 15: 3090068-15.patch, failed testing. View results

swatichouhan012’s picture

Status: Needs work » Needs review
StatusFileSize
new877 bytes

upated code-comment text please review new one.

kualee’s picture

StatusFileSize
new877 bytes

Comment should be sentence case, not title case I believe.
Changed comment from #17

dhirendra.mishra’s picture

+1 for RTBC.

kualee’s picture

naresh_bavaskar’s picture

Status: Needs review » Reviewed & tested by the community

Patch #18 LGTM, +1 RTBC
Thanks

hardik_patel_12’s picture

Status: Reviewed & tested by the community » Needs work

Kindly check #10 , after adding prefix if the user removes the empty message entirely then extra space will before Add a custom block string which is not required . SO solution of this kindly check #11 check empty node block also it is implemented same way.

alexpott’s picture

Status: Needs work » Closed (duplicate)

I'm closing this issue in favour of the duplicate #3095893: Remove duplicate "add block" link from block content type view's "Results not found" message I've created everyone who made a patch contribution here on that issue. Let's work together :)