Issue #2125045 by Eric_A, dawehner: Don't use module on filters anymore.

8.0.x
webchick 2013-12-31 16:17:15 -08:00
parent 3b604ffa21
commit 49ce4b5846
19 changed files with 24 additions and 35 deletions

View File

@ -15,14 +15,14 @@ filters:
# Escape all HTML. # Escape all HTML.
filter_html_escape: filter_html_escape:
id: filter_html_escape id: filter_html_escape
module: filter provider: filter
status: true status: true
weight: -10 weight: -10
settings: { } settings: { }
# Convert URLs into links. # Convert URLs into links.
filter_url: filter_url:
id: filter_url id: filter_url
module: filter provider: filter
status: true status: true
weight: 0 weight: 0
settings: settings:
@ -30,7 +30,7 @@ filters:
# Convert linebreaks into paragraphs. # Convert linebreaks into paragraphs.
filter_autop: filter_autop:
id: filter_autop id: filter_autop
module: filter provider: filter
status: true status: true
weight: 0 weight: 0
settings: { } settings: { }

View File

@ -101,8 +101,8 @@ class FilterBag extends DefaultPluginBag {
if ($a->weight != $b->weight) { if ($a->weight != $b->weight) {
return $a->weight < $b->weight ? -1 : 1; return $a->weight < $b->weight ? -1 : 1;
} }
if ($a->module != $b->module) { if ($a->provider != $b->provider) {
return strnatcasecmp($a->module, $b->module); return strnatcasecmp($a->provider, $b->provider);
} }
return parent::sortHelper($aID, $bID); return parent::sortHelper($aID, $bID);
} }

View File

@ -14,7 +14,6 @@ use Drupal\filter\Plugin\FilterBase;
* *
* @Filter( * @Filter(
* id = "filter_autop", * id = "filter_autop",
* module = "filter",
* title = @Translation("Convert line breaks into HTML (i.e. <code>&lt;br&gt;</code> and <code>&lt;p&gt;</code>)"), * title = @Translation("Convert line breaks into HTML (i.e. <code>&lt;br&gt;</code> and <code>&lt;p&gt;</code>)"),
* type = FILTER_TYPE_MARKUP_LANGUAGE * type = FILTER_TYPE_MARKUP_LANGUAGE
* ) * )

View File

@ -17,7 +17,6 @@ use Drupal\filter\Plugin\FilterBase;
* *
* @Filter( * @Filter(
* id = "filter_caption", * id = "filter_caption",
* module = "filter",
* title = @Translation("Display image captions and align images"), * title = @Translation("Display image captions and align images"),
* description = @Translation("Uses data-caption and data-align attributes on &lt;img&gt; tags to caption and align images."), * description = @Translation("Uses data-caption and data-align attributes on &lt;img&gt; tags to caption and align images."),
* type = FILTER_TYPE_TRANSFORM_REVERSIBLE * type = FILTER_TYPE_TRANSFORM_REVERSIBLE

View File

@ -14,7 +14,6 @@ use Drupal\filter\Plugin\FilterBase;
* *
* @Filter( * @Filter(
* id = "filter_html", * id = "filter_html",
* module = "filter",
* title = @Translation("Limit allowed HTML tags"), * title = @Translation("Limit allowed HTML tags"),
* type = FILTER_TYPE_HTML_RESTRICTOR, * type = FILTER_TYPE_HTML_RESTRICTOR,
* settings = { * settings = {

View File

@ -14,7 +14,6 @@ use Drupal\filter\Plugin\FilterBase;
* *
* @Filter( * @Filter(
* id = "filter_htmlcorrector", * id = "filter_htmlcorrector",
* module = "filter",
* title = @Translation("Correct faulty and chopped off HTML"), * title = @Translation("Correct faulty and chopped off HTML"),
* type = FILTER_TYPE_HTML_RESTRICTOR, * type = FILTER_TYPE_HTML_RESTRICTOR,
* weight = 10 * weight = 10

View File

@ -14,7 +14,6 @@ use Drupal\filter\Plugin\FilterBase;
* *
* @Filter( * @Filter(
* id = "filter_html_escape", * id = "filter_html_escape",
* module = "filter",
* title = @Translation("Display any HTML as plain text"), * title = @Translation("Display any HTML as plain text"),
* type = FILTER_TYPE_HTML_RESTRICTOR, * type = FILTER_TYPE_HTML_RESTRICTOR,
* weight = -10 * weight = -10

View File

@ -14,7 +14,6 @@ use Drupal\filter\Plugin\FilterBase;
* *
* @Filter( * @Filter(
* id = "filter_html_image_secure", * id = "filter_html_image_secure",
* module = "filter",
* title = @Translation("Restrict images to this site"), * title = @Translation("Restrict images to this site"),
* description = @Translation("Disallows usage of &lt;img&gt; tag sources that are not hosted on this site by replacing them with a placeholder image."), * description = @Translation("Disallows usage of &lt;img&gt; tag sources that are not hosted on this site by replacing them with a placeholder image."),
* type = FILTER_TYPE_HTML_RESTRICTOR, * type = FILTER_TYPE_HTML_RESTRICTOR,

View File

@ -18,7 +18,6 @@ use Drupal\filter\Plugin\FilterBase;
* *
* @Filter( * @Filter(
* id = "filter_null", * id = "filter_null",
* module = "filter",
* title = @Translation("Provides a fallback for missing filters. Do not use."), * title = @Translation("Provides a fallback for missing filters. Do not use."),
* type = FILTER_TYPE_HTML_RESTRICTOR, * type = FILTER_TYPE_HTML_RESTRICTOR,
* weight = -10 * weight = -10

View File

@ -14,7 +14,6 @@ use Drupal\filter\Plugin\FilterBase;
* *
* @Filter( * @Filter(
* id = "filter_url", * id = "filter_url",
* module = "filter",
* title = @Translation("Convert URLs into links"), * title = @Translation("Convert URLs into links"),
* type = FILTER_TYPE_MARKUP_LANGUAGE, * type = FILTER_TYPE_MARKUP_LANGUAGE,
* settings = { * settings = {

View File

@ -26,7 +26,7 @@ abstract class FilterBase extends PluginBase implements FilterInterface {
* *
* @var string * @var string
*/ */
public $module; public $provider;
/** /**
* A Boolean indicating whether this filter is enabled. * A Boolean indicating whether this filter is enabled.
@ -71,7 +71,7 @@ abstract class FilterBase extends PluginBase implements FilterInterface {
public function __construct(array $configuration, $plugin_id, array $plugin_definition) { public function __construct(array $configuration, $plugin_id, array $plugin_definition) {
parent::__construct($configuration, $plugin_id, $plugin_definition); parent::__construct($configuration, $plugin_id, $plugin_definition);
$this->module = $this->pluginDefinition['module']; $this->provider = $this->pluginDefinition['provider'];
$this->cache = $this->pluginDefinition['cache']; $this->cache = $this->pluginDefinition['cache'];
$this->setConfiguration($configuration); $this->setConfiguration($configuration);
@ -99,7 +99,7 @@ abstract class FilterBase extends PluginBase implements FilterInterface {
public function getConfiguration() { public function getConfiguration() {
return array( return array(
'id' => $this->getPluginId(), 'id' => $this->getPluginId(),
'module' => $this->pluginDefinition['module'], 'provider' => $this->pluginDefinition['provider'],
'status' => $this->status, 'status' => $this->status,
'weight' => $this->weight, 'weight' => $this->weight,
'settings' => $this->settings, 'settings' => $this->settings,

View File

@ -63,15 +63,15 @@ class FilterDefaultConfigTest extends DrupalUnitTestBase {
$filters = $format->get('filters'); $filters = $format->get('filters');
$this->assertEqual($filters['filter_html_escape']['status'], 1); $this->assertEqual($filters['filter_html_escape']['status'], 1);
$this->assertEqual($filters['filter_html_escape']['weight'], -10); $this->assertEqual($filters['filter_html_escape']['weight'], -10);
$this->assertEqual($filters['filter_html_escape']['module'], 'filter'); $this->assertEqual($filters['filter_html_escape']['provider'], 'filter');
$this->assertEqual($filters['filter_html_escape']['settings'], array()); $this->assertEqual($filters['filter_html_escape']['settings'], array());
$this->assertEqual($filters['filter_autop']['status'], 1); $this->assertEqual($filters['filter_autop']['status'], 1);
$this->assertEqual($filters['filter_autop']['weight'], 0); $this->assertEqual($filters['filter_autop']['weight'], 0);
$this->assertEqual($filters['filter_autop']['module'], 'filter'); $this->assertEqual($filters['filter_autop']['provider'], 'filter');
$this->assertEqual($filters['filter_autop']['settings'], array()); $this->assertEqual($filters['filter_autop']['settings'], array());
$this->assertEqual($filters['filter_url']['status'], 1); $this->assertEqual($filters['filter_url']['status'], 1);
$this->assertEqual($filters['filter_url']['weight'], 0); $this->assertEqual($filters['filter_url']['weight'], 0);
$this->assertEqual($filters['filter_url']['module'], 'filter'); $this->assertEqual($filters['filter_url']['provider'], 'filter');
$this->assertEqual($filters['filter_url']['settings'], array( $this->assertEqual($filters['filter_url']['settings'], array(
'filter_url_length' => 72, 'filter_url_length' => 72,
)); ));

View File

@ -10,19 +10,19 @@ langcode: en
filters: filters:
filter_html_escape: filter_html_escape:
id: filter_html_escape id: filter_html_escape
module: filter provider: filter
status: true status: true
weight: -10 weight: -10
settings: { } settings: { }
filter_autop: filter_autop:
id: filter_autop id: filter_autop
module: filter provider: filter
status: true status: true
weight: 0 weight: 0
settings: { } settings: { }
filter_url: filter_url:
id: filter_url id: filter_url
module: filter provider: filter
status: true status: true
weight: 0 weight: 0
settings: settings:

View File

@ -14,7 +14,6 @@ use Drupal\filter\Plugin\FilterBase;
* *
* @Filter( * @Filter(
* id = "filter_test_replace", * id = "filter_test_replace",
* module = "filter_test",
* title = @Translation("Testing filter"), * title = @Translation("Testing filter"),
* description = @Translation("Replaces all content with filter and text format information."), * description = @Translation("Replaces all content with filter and text format information."),
* type = FILTER_TYPE_TRANSFORM_IRREVERSIBLE * type = FILTER_TYPE_TRANSFORM_IRREVERSIBLE

View File

@ -15,7 +15,6 @@ use Drupal\Component\Utility\Xss;
* *
* @Filter( * @Filter(
* id = "filter_test_restrict_tags_and_attributes", * id = "filter_test_restrict_tags_and_attributes",
* module = "filter_test",
* title = @Translation("Tag and attribute restricting filter"), * title = @Translation("Tag and attribute restricting filter"),
* description = @Translation("Used for testing filter_get_html_restrictions_by_format()."), * description = @Translation("Used for testing filter_get_html_restrictions_by_format()."),
* type = FILTER_TYPE_HTML_RESTRICTOR * type = FILTER_TYPE_HTML_RESTRICTOR

View File

@ -14,7 +14,6 @@ use Drupal\filter\Plugin\FilterBase;
* *
* @Filter( * @Filter(
* id = "filter_test_uncacheable", * id = "filter_test_uncacheable",
* module = "filter_test",
* title = @Translation("Uncacheable filter"), * title = @Translation("Uncacheable filter"),
* description = @Translation("Does nothing, but makes a text format uncacheable"), * description = @Translation("Does nothing, but makes a text format uncacheable"),
* type = FILTER_TYPE_TRANSFORM_IRREVERSIBLE, * type = FILTER_TYPE_TRANSFORM_IRREVERSIBLE,

View File

@ -9,7 +9,7 @@ cache: true
filters: filters:
filter_html: filter_html:
id: filter_html id: filter_html
module: filter provider: filter
status: true status: true
weight: -10 weight: -10
settings: settings:
@ -18,19 +18,19 @@ filters:
filter_html_nofollow: false filter_html_nofollow: false
filter_caption: filter_caption:
id: filter_caption id: filter_caption
module: filter provider: filter
status: 1 status: 1
weight: 8 weight: 8
settings: { } settings: { }
filter_html_image_secure: filter_html_image_secure:
id: filter_html_image_secure id: filter_html_image_secure
module: filter provider: filter
status: true status: true
weight: 9 weight: 9
settings: { } settings: { }
filter_htmlcorrector: filter_htmlcorrector:
id: filter_htmlcorrector id: filter_htmlcorrector
module: filter provider: filter
status: true status: true
weight: 10 weight: 10
settings: { } settings: { }

View File

@ -9,13 +9,13 @@ cache: true
filters: filters:
filter_caption: filter_caption:
id: filter_caption id: filter_caption
module: filter provider: filter
status: true status: true
weight: 9 weight: 9
settings: { } settings: { }
filter_htmlcorrector: filter_htmlcorrector:
id: filter_htmlcorrector id: filter_htmlcorrector
module: filter provider: filter
status: true status: true
weight: 10 weight: 10
settings: { } settings: { }

View File

@ -9,7 +9,7 @@ cache: true
filters: filters:
filter_html: filter_html:
id: filter_html id: filter_html
module: filter provider: filter
status: true status: true
weight: -10 weight: -10
settings: settings:
@ -18,20 +18,20 @@ filters:
filter_html_nofollow: false filter_html_nofollow: false
filter_autop: filter_autop:
id: filter_autop id: filter_autop
module: filter provider: filter
status: true status: true
weight: 0 weight: 0
settings: { } settings: { }
filter_url: filter_url:
id: filter_url id: filter_url
module: filter provider: filter
status: true status: true
weight: 0 weight: 0
settings: settings:
filter_url_length: 72 filter_url_length: 72
filter_htmlcorrector: filter_htmlcorrector:
id: filter_htmlcorrector id: filter_htmlcorrector
module: filter provider: filter
status: true status: true
weight: 10 weight: 10
settings: { } settings: { }