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

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

tim.plunkett’s picture

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

damiankloip’s picture

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.

tim.plunkett’s picture

FileSize
5.13 KB
6.17 KB

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

jibran’s picture

+++ 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. :)

dawehner’s picture

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

damiankloip’s picture

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

dawehner’s picture

Maybe the description is escaped later?

damiankloip’s picture

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

tim.plunkett’s picture

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

damiankloip’s picture

Status: Needs review » Reviewed & tested by the community

Agree that DisplayBlockTest covers this.

webchick’s picture

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.