Issue #2125045 by Eric_A, dawehner: Don't use module on filters anymore.
parent
3b604ffa21
commit
49ce4b5846
|
@ -15,14 +15,14 @@ filters:
|
|||
# Escape all HTML.
|
||||
filter_html_escape:
|
||||
id: filter_html_escape
|
||||
module: filter
|
||||
provider: filter
|
||||
status: true
|
||||
weight: -10
|
||||
settings: { }
|
||||
# Convert URLs into links.
|
||||
filter_url:
|
||||
id: filter_url
|
||||
module: filter
|
||||
provider: filter
|
||||
status: true
|
||||
weight: 0
|
||||
settings:
|
||||
|
@ -30,7 +30,7 @@ filters:
|
|||
# Convert linebreaks into paragraphs.
|
||||
filter_autop:
|
||||
id: filter_autop
|
||||
module: filter
|
||||
provider: filter
|
||||
status: true
|
||||
weight: 0
|
||||
settings: { }
|
||||
|
|
|
@ -101,8 +101,8 @@ class FilterBag extends DefaultPluginBag {
|
|||
if ($a->weight != $b->weight) {
|
||||
return $a->weight < $b->weight ? -1 : 1;
|
||||
}
|
||||
if ($a->module != $b->module) {
|
||||
return strnatcasecmp($a->module, $b->module);
|
||||
if ($a->provider != $b->provider) {
|
||||
return strnatcasecmp($a->provider, $b->provider);
|
||||
}
|
||||
return parent::sortHelper($aID, $bID);
|
||||
}
|
||||
|
|
|
@ -14,7 +14,6 @@ use Drupal\filter\Plugin\FilterBase;
|
|||
*
|
||||
* @Filter(
|
||||
* id = "filter_autop",
|
||||
* module = "filter",
|
||||
* title = @Translation("Convert line breaks into HTML (i.e. <code><br></code> and <code><p></code>)"),
|
||||
* type = FILTER_TYPE_MARKUP_LANGUAGE
|
||||
* )
|
||||
|
|
|
@ -17,7 +17,6 @@ use Drupal\filter\Plugin\FilterBase;
|
|||
*
|
||||
* @Filter(
|
||||
* id = "filter_caption",
|
||||
* module = "filter",
|
||||
* title = @Translation("Display image captions and align images"),
|
||||
* description = @Translation("Uses data-caption and data-align attributes on <img> tags to caption and align images."),
|
||||
* type = FILTER_TYPE_TRANSFORM_REVERSIBLE
|
||||
|
|
|
@ -14,7 +14,6 @@ use Drupal\filter\Plugin\FilterBase;
|
|||
*
|
||||
* @Filter(
|
||||
* id = "filter_html",
|
||||
* module = "filter",
|
||||
* title = @Translation("Limit allowed HTML tags"),
|
||||
* type = FILTER_TYPE_HTML_RESTRICTOR,
|
||||
* settings = {
|
||||
|
|
|
@ -14,7 +14,6 @@ use Drupal\filter\Plugin\FilterBase;
|
|||
*
|
||||
* @Filter(
|
||||
* id = "filter_htmlcorrector",
|
||||
* module = "filter",
|
||||
* title = @Translation("Correct faulty and chopped off HTML"),
|
||||
* type = FILTER_TYPE_HTML_RESTRICTOR,
|
||||
* weight = 10
|
||||
|
|
|
@ -14,7 +14,6 @@ use Drupal\filter\Plugin\FilterBase;
|
|||
*
|
||||
* @Filter(
|
||||
* id = "filter_html_escape",
|
||||
* module = "filter",
|
||||
* title = @Translation("Display any HTML as plain text"),
|
||||
* type = FILTER_TYPE_HTML_RESTRICTOR,
|
||||
* weight = -10
|
||||
|
|
|
@ -14,7 +14,6 @@ use Drupal\filter\Plugin\FilterBase;
|
|||
*
|
||||
* @Filter(
|
||||
* id = "filter_html_image_secure",
|
||||
* module = "filter",
|
||||
* title = @Translation("Restrict images to this site"),
|
||||
* description = @Translation("Disallows usage of <img> tag sources that are not hosted on this site by replacing them with a placeholder image."),
|
||||
* type = FILTER_TYPE_HTML_RESTRICTOR,
|
||||
|
|
|
@ -18,7 +18,6 @@ use Drupal\filter\Plugin\FilterBase;
|
|||
*
|
||||
* @Filter(
|
||||
* id = "filter_null",
|
||||
* module = "filter",
|
||||
* title = @Translation("Provides a fallback for missing filters. Do not use."),
|
||||
* type = FILTER_TYPE_HTML_RESTRICTOR,
|
||||
* weight = -10
|
||||
|
|
|
@ -14,7 +14,6 @@ use Drupal\filter\Plugin\FilterBase;
|
|||
*
|
||||
* @Filter(
|
||||
* id = "filter_url",
|
||||
* module = "filter",
|
||||
* title = @Translation("Convert URLs into links"),
|
||||
* type = FILTER_TYPE_MARKUP_LANGUAGE,
|
||||
* settings = {
|
||||
|
|
|
@ -26,7 +26,7 @@ abstract class FilterBase extends PluginBase implements FilterInterface {
|
|||
*
|
||||
* @var string
|
||||
*/
|
||||
public $module;
|
||||
public $provider;
|
||||
|
||||
/**
|
||||
* 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) {
|
||||
parent::__construct($configuration, $plugin_id, $plugin_definition);
|
||||
|
||||
$this->module = $this->pluginDefinition['module'];
|
||||
$this->provider = $this->pluginDefinition['provider'];
|
||||
$this->cache = $this->pluginDefinition['cache'];
|
||||
|
||||
$this->setConfiguration($configuration);
|
||||
|
@ -99,7 +99,7 @@ abstract class FilterBase extends PluginBase implements FilterInterface {
|
|||
public function getConfiguration() {
|
||||
return array(
|
||||
'id' => $this->getPluginId(),
|
||||
'module' => $this->pluginDefinition['module'],
|
||||
'provider' => $this->pluginDefinition['provider'],
|
||||
'status' => $this->status,
|
||||
'weight' => $this->weight,
|
||||
'settings' => $this->settings,
|
||||
|
|
|
@ -63,15 +63,15 @@ class FilterDefaultConfigTest extends DrupalUnitTestBase {
|
|||
$filters = $format->get('filters');
|
||||
$this->assertEqual($filters['filter_html_escape']['status'], 1);
|
||||
$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_autop']['status'], 1);
|
||||
$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_url']['status'], 1);
|
||||
$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(
|
||||
'filter_url_length' => 72,
|
||||
));
|
||||
|
|
|
@ -10,19 +10,19 @@ langcode: en
|
|||
filters:
|
||||
filter_html_escape:
|
||||
id: filter_html_escape
|
||||
module: filter
|
||||
provider: filter
|
||||
status: true
|
||||
weight: -10
|
||||
settings: { }
|
||||
filter_autop:
|
||||
id: filter_autop
|
||||
module: filter
|
||||
provider: filter
|
||||
status: true
|
||||
weight: 0
|
||||
settings: { }
|
||||
filter_url:
|
||||
id: filter_url
|
||||
module: filter
|
||||
provider: filter
|
||||
status: true
|
||||
weight: 0
|
||||
settings:
|
||||
|
|
|
@ -14,7 +14,6 @@ use Drupal\filter\Plugin\FilterBase;
|
|||
*
|
||||
* @Filter(
|
||||
* id = "filter_test_replace",
|
||||
* module = "filter_test",
|
||||
* title = @Translation("Testing filter"),
|
||||
* description = @Translation("Replaces all content with filter and text format information."),
|
||||
* type = FILTER_TYPE_TRANSFORM_IRREVERSIBLE
|
||||
|
|
|
@ -15,7 +15,6 @@ use Drupal\Component\Utility\Xss;
|
|||
*
|
||||
* @Filter(
|
||||
* id = "filter_test_restrict_tags_and_attributes",
|
||||
* module = "filter_test",
|
||||
* title = @Translation("Tag and attribute restricting filter"),
|
||||
* description = @Translation("Used for testing filter_get_html_restrictions_by_format()."),
|
||||
* type = FILTER_TYPE_HTML_RESTRICTOR
|
||||
|
|
|
@ -14,7 +14,6 @@ use Drupal\filter\Plugin\FilterBase;
|
|||
*
|
||||
* @Filter(
|
||||
* id = "filter_test_uncacheable",
|
||||
* module = "filter_test",
|
||||
* title = @Translation("Uncacheable filter"),
|
||||
* description = @Translation("Does nothing, but makes a text format uncacheable"),
|
||||
* type = FILTER_TYPE_TRANSFORM_IRREVERSIBLE,
|
||||
|
|
|
@ -9,7 +9,7 @@ cache: true
|
|||
filters:
|
||||
filter_html:
|
||||
id: filter_html
|
||||
module: filter
|
||||
provider: filter
|
||||
status: true
|
||||
weight: -10
|
||||
settings:
|
||||
|
@ -18,19 +18,19 @@ filters:
|
|||
filter_html_nofollow: false
|
||||
filter_caption:
|
||||
id: filter_caption
|
||||
module: filter
|
||||
provider: filter
|
||||
status: 1
|
||||
weight: 8
|
||||
settings: { }
|
||||
filter_html_image_secure:
|
||||
id: filter_html_image_secure
|
||||
module: filter
|
||||
provider: filter
|
||||
status: true
|
||||
weight: 9
|
||||
settings: { }
|
||||
filter_htmlcorrector:
|
||||
id: filter_htmlcorrector
|
||||
module: filter
|
||||
provider: filter
|
||||
status: true
|
||||
weight: 10
|
||||
settings: { }
|
||||
|
|
|
@ -9,13 +9,13 @@ cache: true
|
|||
filters:
|
||||
filter_caption:
|
||||
id: filter_caption
|
||||
module: filter
|
||||
provider: filter
|
||||
status: true
|
||||
weight: 9
|
||||
settings: { }
|
||||
filter_htmlcorrector:
|
||||
id: filter_htmlcorrector
|
||||
module: filter
|
||||
provider: filter
|
||||
status: true
|
||||
weight: 10
|
||||
settings: { }
|
||||
|
|
|
@ -9,7 +9,7 @@ cache: true
|
|||
filters:
|
||||
filter_html:
|
||||
id: filter_html
|
||||
module: filter
|
||||
provider: filter
|
||||
status: true
|
||||
weight: -10
|
||||
settings:
|
||||
|
@ -18,20 +18,20 @@ filters:
|
|||
filter_html_nofollow: false
|
||||
filter_autop:
|
||||
id: filter_autop
|
||||
module: filter
|
||||
provider: filter
|
||||
status: true
|
||||
weight: 0
|
||||
settings: { }
|
||||
filter_url:
|
||||
id: filter_url
|
||||
module: filter
|
||||
provider: filter
|
||||
status: true
|
||||
weight: 0
|
||||
settings:
|
||||
filter_url_length: 72
|
||||
filter_htmlcorrector:
|
||||
id: filter_htmlcorrector
|
||||
module: filter
|
||||
provider: filter
|
||||
status: true
|
||||
weight: 10
|
||||
settings: { }
|
||||
|
|
Loading…
Reference in New Issue