Using $this->t() instead of t() in this popular plugin type sets an example for all contrib plugins. (And replacing t() with $this->t() gets us very close to being able to unit test filter plugins, because all that's left then is the coupling with the filter.module process callback functions.)

Comments

eric_a’s picture

StatusFileSize
new18.5 KB
eric_a’s picture

Status: Active » Needs review
martin107’s picture

Status: Needs review » Needs work
Issue tags: +Needs reroll

Patch no longer applies.

eric_a’s picture

Status: Needs work » Needs review
Issue tags: -Needs reroll
StatusFileSize
new18.5 KB

Rerolled for #2203407: Replace #attached library array values with provider-namespaced strings where the following change happened.

X-Git-Url: http://drupalcode.org/project/drupal.git/blobdiff_plain/1d1c63d2a72e0f86311c8c67dddc4d02556dd6f6..01a3e19:/core/modules/filter/lib/Drupal/filter/Plugin/Filter/FilterHtml.php

diff --git a/core/modules/filter/lib/Drupal/filter/Plugin/Filter/FilterHtml.php b/core/modules/filter/lib/Drupal/filter/Plugin/Filter/FilterHtml.php
index a7c73c4..dcb931c 100644
--- a/core/modules/filter/lib/Drupal/filter/Plugin/Filter/FilterHtml.php
+++ b/core/modules/filter/lib/Drupal/filter/Plugin/Filter/FilterHtml.php
@@ -38,7 +38,7 @@ class FilterHtml extends FilterBase {
       '#description' => t('A list of HTML tags that can be used. JavaScript event attributes, JavaScript URLs, and CSS are always stripped.'),
       '#attached' => array(
         'library' => array(
-          array('filter', 'drupal.filter.filter_html.admin'),
+          'filter/drupal.filter.filter_html.admin',
         ),
       ),
     );
sutharsan’s picture

Status: Needs review » Reviewed & tested by the community

Check for remaining t() usage after applying the patch. None found.
Patch still applies.
I have no comments on the patch.

sutharsan’s picture

Inspired by this issue, I've continued with block plugins: #2223435: Do not use t() in block plugins anymore

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 4: filter-plugins-no-more-t-2165427-4.patch, failed testing.

eric_a’s picture

Status: Needs work » Needs review
eric_a’s picture

Status: Needs review » Reviewed & tested by the community

Failure in #7 was absolutely unrelated to this patch:

The test did not complete due to a fatal error.
Drupal\locale\Tests\LocaleUpdateTest->testUpdateCheckStatus()

Requeued and back to RTBC.

webchick’s picture

Priority: Major » Normal

This is just code clean-up, so doesn't really fit as major. I'll get back to this shortly, doing a quick triage of the queue.

webchick’s picture

Status: Reviewed & tested by the community » Fixed

Ok, here we go!

Committed and pushed to 8.x. Thanks!

  • Commit bd2cfd0 on 8.x by webchick:
    Issue #2165427 by Eric_A: Don't use t() in filter plugins anymore.
    

Status: Fixed » Closed (fixed)

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