Updated: Comment #N

Problem/Motivation

Now that we have block categories on the block listing page it doesn't make sense to prefix views blocks with 'View:'

Proposed resolution

Remove this hardcoded prefix from the block admin_label created in the ViewsBlock derivative class.

Remaining tasks

Patch, review, etc...

User interface changes

'View:' prefix will disappear from views blocks in block UI listings

API changes

None

#2071019: Allow the block category for Views block displays to be edited

Files: 
CommentFileSizeAuthor
#4 vdc-2086447-4.patch6.17 KBtim.plunkett
PASSED: [[SimpleTest]]: [MySQL] 58,850 pass(es).
[ View ]
#4 interdiff.txt5.13 KBtim.plunkett
db.viewsBlock-remove-prefix.patch1.04 KBdamiankloip
FAILED: [[SimpleTest]]: [MySQL] 59,211 pass(es), 8 fail(s), and 0 exception(s).
[ View ]

Comments

If this passes, we should add tests. Especially for that if/else for the display being appended.

Status:Needs work» Needs review

I'm pretty sure the title is not being tested currently. Not explicitly anyway.

Status:Needs review» Needs work

The last submitted patch, db.viewsBlock-remove-prefix.patch, failed testing.

StatusFileSize
new5.13 KB
new6.17 KB
PASSED: [[SimpleTest]]: [MySQL] 58,850 pass(es).
[ View ]

Drupal\block\Tests\Views\DisplayBlockTest failing is good enough for me (and that's not the only one)

+++ b/core/modules/views/lib/Drupal/views/Plugin/Derivative/ViewsBlock.php
@@ -93,10 +93,10 @@ public function getDerivativeDefinitions(array $base_plugin_definition) {
+              $desc = t('!view', array('!view' => $view->label()));
...
+              $desc = t('!view: !display', array('!view' => $view->label(), '!display' => $display->display['display_title']));

Let's remove t seems redundant anyways. :)

Does someone understand why/whether the label is escaped on $view->label() already?

I guess it's totally not, just comes directly from the property.

Maybe the description is escaped later?

Well, I think the BlockListController will escape it before rendering. Is that what you mean?

Yes these are assumed to be unescaped by the block list (and elsewhere), we explicitly call check_plain in those places

Status:Needs review» Reviewed & tested by the community

Agree that DisplayBlockTest covers this.

Status:Reviewed & tested by the community» Fixed

Awesome. Thanks folks!

Committed and pushed to 8.x.

Automatically closed -- issue fixed for 2 weeks with no activity.