Updated: Comment #N


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


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

#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 ]


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

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)

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.