Skip to content
Commits on Source (22)
...@@ -2047,7 +2047,7 @@ function hook_mail_alter(&$message) { ...@@ -2047,7 +2047,7 @@ function hook_mail_alter(&$message) {
* An array of parameters supplied by the caller of * An array of parameters supplied by the caller of
* MailManagerInterface->mail(). * MailManagerInterface->mail().
* *
* @see \Drupal\Core\Mail\MailManagerInterface->mail() * @see \Drupal\Core\Mail\MailManagerInterface::mail()
*/ */
function hook_mail($key, &$message, $params) { function hook_mail($key, &$message, $params) {
$account = $params['account']; $account = $params['account'];
......
...@@ -1220,7 +1220,9 @@ function file_directory_os_temp() { ...@@ -1220,7 +1220,9 @@ function file_directory_os_temp() {
foreach ($directories as $directory) { foreach ($directories as $directory) {
if (is_dir($directory) && is_writable($directory)) { if (is_dir($directory) && is_writable($directory)) {
return $directory; // Both sys_get_temp_dir() and ini_get('upload_tmp_dir') can return paths
// with a trailing directory separator.
return rtrim($directory, DIRECTORY_SEPARATOR);
} }
} }
return FALSE; return FALSE;
......
...@@ -596,7 +596,7 @@ function update_already_performed($module, $number) { ...@@ -596,7 +596,7 @@ function update_already_performed($module, $number) {
* An array of return values obtained by merging the results of the * An array of return values obtained by merging the results of the
* hook_update_dependencies() implementations in all installed modules. * hook_update_dependencies() implementations in all installed modules.
* *
* @see \Drupal::moduleHandler()->invokeAll() * @see \Drupal\Core\Extension\ModuleHandlerInterface::invokeAll()
* @see hook_update_dependencies() * @see hook_update_dependencies()
*/ */
function update_retrieve_dependencies() { function update_retrieve_dependencies() {
......
...@@ -81,7 +81,7 @@ class Drupal { ...@@ -81,7 +81,7 @@ class Drupal {
/** /**
* The current system version. * The current system version.
*/ */
const VERSION = '8.1.9-dev'; const VERSION = '8.1.11-dev';
/** /**
* Core API compatibility. * Core API compatibility.
......
...@@ -23,7 +23,7 @@ class Schema extends DatabaseSchema { ...@@ -23,7 +23,7 @@ class Schema extends DatabaseSchema {
* This is collected by DatabaseConnection_pgsql->queryTableInformation(), * This is collected by DatabaseConnection_pgsql->queryTableInformation(),
* by introspecting the database. * by introspecting the database.
* *
* @see DatabaseConnection_pgsql->queryTableInformation() * @see \Drupal\Core\Database\Driver\pgsql\Schema::queryTableInformation()
* @var array * @var array
*/ */
protected $tableInformation = array(); protected $tableInformation = array();
......
...@@ -297,7 +297,7 @@ protected static function matchEntityByTitle(SelectionInterface $handler, $input ...@@ -297,7 +297,7 @@ protected static function matchEntityByTitle(SelectionInterface $handler, $input
$multiples[] = $name . ' (' . $id . ')'; $multiples[] = $name . ' (' . $id . ')';
} }
$params['@id'] = $id; $params['@id'] = $id;
$form_state->setError($element, t('Multiple entities match this reference; "%multiple". Specify the one you want by appending the id in parentheses, like "@value (@id)".', array('%multiple' => implode('", "', $multiples)))); $form_state->setError($element, t('Multiple entities match this reference; "%multiple". Specify the one you want by appending the id in parentheses, like "@value (@id)".', array('%multiple' => implode('", "', $multiples)) + $params));
} }
else { else {
// Take the one and only matching entity. // Take the one and only matching entity.
......
...@@ -188,13 +188,16 @@ public function onException(GetResponseForExceptionEvent $event) { ...@@ -188,13 +188,16 @@ public function onException(GetResponseForExceptionEvent $event) {
if (!method_exists($this, $method)) { if (!method_exists($this, $method)) {
if ($exception instanceof HttpExceptionInterface) { if ($exception instanceof HttpExceptionInterface) {
$this->onFormatUnknown($event); $this->onFormatUnknown($event);
$response = $event->getResponse();
$response->headers->set('Content-Type', 'text/plain');
} }
else { else {
$this->onHtml($event); $this->onHtml($event);
} }
return;
} }
$this->$method($event); else {
$this->$method($event);
}
} }
/** /**
......
...@@ -172,7 +172,7 @@ function getProjectName(Extension $file) { ...@@ -172,7 +172,7 @@ function getProjectName(Extension $file) {
* @return * @return
* Array of .info.yml file data we need for the update manager. * Array of .info.yml file data we need for the update manager.
* *
* @see \Drupal\Core\Utility\ProjectInfo->processInfoList() * @see \Drupal\Core\Utility\ProjectInfo::processInfoList()
*/ */
function filterProjectInfo($info, $additional_whitelist = array()) { function filterProjectInfo($info, $additional_whitelist = array()) {
$whitelist = array( $whitelist = array(
......
...@@ -2,7 +2,9 @@ ...@@ -2,7 +2,9 @@
namespace Drupal\comment; namespace Drupal\comment;
use Drupal\Core\Access\AccessResult;
use Drupal\Core\Field\FieldItemList; use Drupal\Core\Field\FieldItemList;
use Drupal\Core\Session\AccountInterface;
/** /**
* Defines a item list class for comment fields. * Defines a item list class for comment fields.
...@@ -37,4 +39,28 @@ public function offsetExists($offset) { ...@@ -37,4 +39,28 @@ public function offsetExists($offset) {
return parent::offsetExists($offset); return parent::offsetExists($offset);
} }
/**
* {@inheritdoc}
*/
public function access($operation = 'view', AccountInterface $account = NULL, $return_as_object = FALSE) {
if ($operation === 'edit') {
// Only users with administer comments permission can edit the comment
// status field.
$result = AccessResult::allowedIfHasPermission($account ?: \Drupal::currentUser(), 'administer comments');
return $return_as_object ? $result : $result->isAllowed();
}
if ($operation === 'view') {
// Only users with either post comments or access comments permisison can
// view the field value. The formatter,
// Drupal\comment\Plugin\Field\FieldFormatter\CommentDefaultFormatter,
// takes care of showing the thread and form based on individual
// permissions, so if a user only has ‘post comments’ access, only the
// form will be shown and not the comments.
$result = AccessResult::allowedIfHasPermission($account ?: \Drupal::currentUser(), 'access comments')
->orIf(AccessResult::allowedIfHasPermission($account ?: \Drupal::currentUser(), 'post comments'));
return $return_as_object ? $result : $result->isAllowed();
}
return parent::access($operation, $account, $return_as_object);
}
} }
...@@ -384,6 +384,7 @@ function testCommentFunctionality() { ...@@ -384,6 +384,7 @@ function testCommentFunctionality() {
'administer entity_test fields', 'administer entity_test fields',
'view test entity', 'view test entity',
'administer entity_test content', 'administer entity_test content',
'administer comments',
)); ));
$this->drupalLogin($limited_user); $this->drupalLogin($limited_user);
$this->drupalGet('entity_test/structure/entity_test/fields/entity_test.entity_test.comment'); $this->drupalGet('entity_test/structure/entity_test/fields/entity_test.entity_test.comment');
......
<?php
namespace Drupal\Tests\comment\Functional;
use Drupal\comment\Tests\CommentTestTrait;
use Drupal\node\Entity\NodeType;
use Drupal\Tests\BrowserTestBase;
/**
* Tests comment status field access.
*
* @group comment
*/
class CommentStatusFieldAccessTest extends BrowserTestBase {
use CommentTestTrait;
/**
* {@inheritdoc}
*/
public $profile = 'testing';
/**
* Comment admin.
*
* @var \Drupal\user\UserInterface
*/
protected $commentAdmin;
/**
* Node author.
*
* @var \Drupal\user\UserInterface
*/
protected $nodeAuthor;
/**
* {@inheritdoc}
*/
public static $modules = [
'node',
'comment',
'user',
'system',
'text',
];
/**
* {@inheritdoc}
*/
protected function setUp() {
parent::setUp();
$node_type = NodeType::create([
'type' => 'article',
'name' => t('Article'),
]);
$node_type->save();
$this->nodeAuthor = $this->drupalCreateUser([
'create article content',
'skip comment approval',
'post comments',
'edit own comments',
'access comments',
'administer nodes',
]);
$this->commentAdmin = $this->drupalCreateUser([
'administer comments',
'create article content',
'edit own comments',
'skip comment approval',
'post comments',
'access comments',
'administer nodes',
]);
$this->addDefaultCommentField('node', 'article');
}
/**
* Tests comment status field access.
*/
public function testCommentStatusFieldAccessStatus() {
$this->drupalLogin($this->nodeAuthor);
$this->drupalGet('node/add/article');
$assert = $this->assertSession();
$assert->fieldNotExists('comment[0][status]');
$this->submitForm([
'title[0][value]' => 'Node 1',
], t('Save and publish'));
$assert->fieldExists('subject[0][value]');
$this->drupalLogin($this->commentAdmin);
$this->drupalGet('node/add/article');
$assert->fieldExists('comment[0][status]');
$this->submitForm([
'title[0][value]' => 'Node 2',
], t('Save and publish'));
$assert->fieldExists('subject[0][value]');
}
}
...@@ -65,14 +65,17 @@ function config_file_download($uri) { ...@@ -65,14 +65,17 @@ function config_file_download($uri) {
$scheme = file_uri_scheme($uri); $scheme = file_uri_scheme($uri);
$target = file_uri_target($uri); $target = file_uri_target($uri);
if ($scheme == 'temporary' && $target == 'config.tar.gz') { if ($scheme == 'temporary' && $target == 'config.tar.gz') {
$request = \Drupal::request(); if (\Drupal::currentUser()->hasPermission('export configuration')) {
$date = DateTime::createFromFormat('U', $request->server->get('REQUEST_TIME')); $request = \Drupal::request();
$date_string = $date->format('Y-m-d-H-i'); $date = DateTime::createFromFormat('U', $request->server->get('REQUEST_TIME'));
$hostname = str_replace('.', '-', $request->getHttpHost()); $date_string = $date->format('Y-m-d-H-i');
$filename = 'config' . '-' . $hostname . '-' . $date_string . '.tar.gz'; $hostname = str_replace('.', '-', $request->getHttpHost());
$disposition = 'attachment; filename="' . $filename . '"'; $filename = 'config' . '-' . $hostname . '-' . $date_string . '.tar.gz';
return array( $disposition = 'attachment; filename="' . $filename . '"';
'Content-disposition' => $disposition, return array(
); 'Content-disposition' => $disposition,
);
}
return -1;
} }
} }
...@@ -88,6 +88,12 @@ function testExport() { ...@@ -88,6 +88,12 @@ function testExport() {
// Check the single export form doesn't have "form-required" elements. // Check the single export form doesn't have "form-required" elements.
$this->drupalGet('admin/config/development/configuration/single/export'); $this->drupalGet('admin/config/development/configuration/single/export');
$this->assertNoRaw('js-form-required form-required', 'No form required fields are found.'); $this->assertNoRaw('js-form-required form-required', 'No form required fields are found.');
// Ensure the temporary file is not available to users without the
// permission.
$this->drupalLogout();
$this->drupalGet('system/temporary', ['query' => ['file' => 'config.tar.gz']]);
$this->assertResponse(403);
} }
} }
...@@ -3,12 +3,12 @@ ...@@ -3,12 +3,12 @@
namespace Drupal\field\Plugin\migrate\process; namespace Drupal\field\Plugin\migrate\process;
use Drupal\Component\Plugin\Exception\PluginNotFoundException; use Drupal\Component\Plugin\Exception\PluginNotFoundException;
use Drupal\Component\Plugin\PluginManagerInterface;
use Drupal\Core\Plugin\ContainerFactoryPluginInterface; use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
use Drupal\migrate\MigrateExecutableInterface; use Drupal\migrate\MigrateExecutableInterface;
use Drupal\migrate\Plugin\MigrationInterface; use Drupal\migrate\Plugin\MigrationInterface;
use Drupal\migrate\Plugin\migrate\process\StaticMap; use Drupal\migrate\Plugin\migrate\process\StaticMap;
use Drupal\migrate\Row; use Drupal\migrate\Row;
use Drupal\migrate_drupal\Plugin\MigrateCckFieldPluginManagerInterface;
use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\DependencyInjection\ContainerInterface;
/** /**
...@@ -21,7 +21,7 @@ class FieldType extends StaticMap implements ContainerFactoryPluginInterface { ...@@ -21,7 +21,7 @@ class FieldType extends StaticMap implements ContainerFactoryPluginInterface {
/** /**
* The cckfield plugin manager. * The cckfield plugin manager.
* *
* @var \Drupal\Component\Plugin\PluginManagerInterface * @var \Drupal\migrate_drupal\Plugin\MigrateCckFieldPluginManagerInterface
*/ */
protected $cckPluginManager; protected $cckPluginManager;
...@@ -41,12 +41,12 @@ class FieldType extends StaticMap implements ContainerFactoryPluginInterface { ...@@ -41,12 +41,12 @@ class FieldType extends StaticMap implements ContainerFactoryPluginInterface {
* The plugin ID. * The plugin ID.
* @param mixed $plugin_definition * @param mixed $plugin_definition
* The plugin definition. * The plugin definition.
* @param \Drupal\Component\Plugin\PluginManagerInterface $cck_plugin_manager * @param \Drupal\migrate_drupal\Plugin\MigrateCckFieldPluginManagerInterface $cck_plugin_manager
* The cckfield plugin manager. * The cckfield plugin manager.
* @param \Drupal\migrate\Plugin\MigrationInterface $migration * @param \Drupal\migrate\Plugin\MigrationInterface $migration
* The migration being run. * The migration being run.
*/ */
public function __construct(array $configuration, $plugin_id, $plugin_definition, PluginManagerInterface $cck_plugin_manager, MigrationInterface $migration = NULL) { public function __construct(array $configuration, $plugin_id, $plugin_definition, MigrateCckFieldPluginManagerInterface $cck_plugin_manager, MigrationInterface $migration = NULL) {
parent::__construct($configuration, $plugin_id, $plugin_definition); parent::__construct($configuration, $plugin_id, $plugin_definition);
$this->cckPluginManager = $cck_plugin_manager; $this->cckPluginManager = $cck_plugin_manager;
$this->migration = $migration; $this->migration = $migration;
...@@ -72,7 +72,8 @@ public function transform($value, MigrateExecutableInterface $migrate_executable ...@@ -72,7 +72,8 @@ public function transform($value, MigrateExecutableInterface $migrate_executable
$field_type = is_array($value) ? $value[0] : $value; $field_type = is_array($value) ? $value[0] : $value;
try { try {
return $this->cckPluginManager->createInstance($field_type, [], $this->migration)->getFieldType($row); $plugin_id = $this->cckPluginManager->getPluginIdFromFieldType($field_type, [], $this->migration);
return $this->cckPluginManager->createInstance($plugin_id, [], $this->migration)->getFieldType($row);
} }
catch (PluginNotFoundException $e) { catch (PluginNotFoundException $e) {
return parent::transform($value, $migrate_executable, $row, $destination_property); return parent::transform($value, $migrate_executable, $row, $destination_property);
......
...@@ -208,6 +208,7 @@ public function testFieldAdminHandler() { ...@@ -208,6 +208,7 @@ public function testFieldAdminHandler() {
'id' => 'node_test_view', 'id' => 'node_test_view',
'label' => 'Node Test View', 'label' => 'Node Test View',
'show[wizard_key]' => 'node', 'show[wizard_key]' => 'node',
'show[sort]' => 'none',
'page[create]' => 1, 'page[create]' => 1,
'page[title]' => 'Test Node View', 'page[title]' => 'Test Node View',
'page[path]' => 'test/node/view', 'page[path]' => 'test/node/view',
...@@ -221,6 +222,14 @@ public function testFieldAdminHandler() { ...@@ -221,6 +222,14 @@ public function testFieldAdminHandler() {
'style_options[search_fields][title]' => 'title', 'style_options[search_fields][title]' => 'title',
); );
$this->drupalPostForm(NULL, $edit, t('Apply')); $this->drupalPostForm(NULL, $edit, t('Apply'));
// Set sort to NID ascending.
$edit = [
'name[node_field_data.nid]' => 1,
];
$this->drupalPostForm('admin/structure/views/nojs/add-handler/node_test_view/entity_reference_1/sort', $edit, t('Add and configure sort criteria'));
$this->drupalPostForm(NULL, NULL, t('Apply'));
$this->drupalPostForm('admin/structure/views/view/node_test_view/edit/entity_reference_1', array(), t('Save')); $this->drupalPostForm('admin/structure/views/view/node_test_view/edit/entity_reference_1', array(), t('Save'));
$this->clickLink(t('Settings')); $this->clickLink(t('Settings'));
...@@ -301,6 +310,7 @@ public function testFieldAdminHandler() { ...@@ -301,6 +310,7 @@ public function testFieldAdminHandler() {
$this->assertText(t('Multiple entities match this reference;')); $this->assertText(t('Multiple entities match this reference;'));
$this->assertText(t("@node1", ['@node1' => $node1->getTitle() . ' (' . $node1->id() . ')'])); $this->assertText(t("@node1", ['@node1' => $node1->getTitle() . ' (' . $node1->id() . ')']));
$this->assertText(t("@node2", ['@node2' => $node2->getTitle() . ' (' . $node2->id() . ')'])); $this->assertText(t("@node2", ['@node2' => $node2->getTitle() . ' (' . $node2->id() . ')']));
$this->assertText(t('Specify the one you want by appending the id in parentheses, like "@example".', ['@example' => $node2->getTitle() . ' (' . $node2->id() . ')']));
$edit = array( $edit = array(
'title[0][value]' => 'Test', 'title[0][value]' => 'Test',
......
...@@ -81,9 +81,11 @@ public function delete() { ...@@ -81,9 +81,11 @@ public function delete() {
parent::delete(); parent::delete();
$entity = $this->getEntity(); $entity = $this->getEntity();
// Delete all file usages within this entity. // If a translation is deleted only decrement the file usage by one. If the
// default translation is deleted remove all file usages within this entity.
$count = $entity->isDefaultTranslation() ? 0 : 1;
foreach ($this->referencedEntities() as $file) { foreach ($this->referencedEntities() as $file) {
\Drupal::service('file.usage')->delete($file, 'file', $entity->getEntityTypeId(), $entity->id(), 0); \Drupal::service('file.usage')->delete($file, 'file', $entity->getEntityTypeId(), $entity->id(), $count);
} }
} }
......
...@@ -2,6 +2,13 @@ ...@@ -2,6 +2,13 @@
namespace Drupal\Tests\file\Kernel; namespace Drupal\Tests\file\Kernel;
use Drupal\field\Entity\FieldConfig;
use Drupal\field\Entity\FieldStorageConfig;
use Drupal\language\Entity\ConfigurableLanguage;
use Drupal\language\Entity\ContentLanguageSettings;
use Drupal\node\Entity\Node;
use Drupal\node\Entity\NodeType;
/** /**
* Tests file usage functions. * Tests file usage functions.
* *
...@@ -203,4 +210,57 @@ function testTempFileCustomCleanup() { ...@@ -203,4 +210,57 @@ function testTempFileCustomCleanup() {
$this->assertTrue(file_exists($perm_new->getFileUri()), 'New permanent file was correctly ignored.'); $this->assertTrue(file_exists($perm_new->getFileUri()), 'New permanent file was correctly ignored.');
} }
/**
* Tests file usage with translated entities.
*/
public function testFileUsageWithEntityTranslation() {
/** @var \Drupal\file\FileUsage\FileUsageInterface $file_usage */
$file_usage = $this->container->get('file.usage');
$this->enableModules(['node', 'language']);
$this->installEntitySchema('node');
$this->installSchema('node', ['node_access']);
// Activate English and Romanian languages.
ConfigurableLanguage::create(['id' => 'en'])->save();
ConfigurableLanguage::create(['id' => 'ro'])->save();
NodeType::create(['type' => 'page'])->save();
ContentLanguageSettings::loadByEntityTypeBundle('node', 'page')
->setLanguageAlterable(FALSE)
->setDefaultLangcode('en')
->save();
// Create a file field attached to 'page' node-type.
FieldStorageConfig::create([
'type' => 'file',
'entity_type' => 'node',
'field_name' => 'file',
])->save();
FieldConfig::create([
'entity_type' => 'node',
'bundle' => 'page',
'field_name' => 'file',
'label' => 'File',
])->save();
// Create a node, attach a file and add a Romanian translation.
$node = Node::create(['type' => 'page', 'title' => 'Page']);
$node
->set('file', $file = $this->createFile())
->addTranslation('ro', $node->getTranslation('en')->toArray())
->save();
// Check that the file is used twice.
$usage = $file_usage->listUsage($file);
$this->assertEquals(2, $usage['file']['node'][$node->id()]);
// Remove the Romanian translation.
$node->removeTranslation('ro');
$node->save();
// Check that one usage has been removed and is used only once now.
$usage = $file_usage->listUsage($file);
$this->assertEquals(1, $usage['file']['node'][$node->id()]);
}
} }
...@@ -16,11 +16,16 @@ process: ...@@ -16,11 +16,16 @@ process:
key: '@id' key: '@id'
process: process:
id: id:
plugin: static_map # If the filter ID cannot be mapped, it will be passed through
default_value: filter_null # unchanged because the bypass flag is set. The filter_id plugin
# will flatten the input value and default it to filter_null (the
# fallback filter plugin ID) if the flattened input value is not
# a valid plugin ID.
plugin: filter_id
source: source:
- module - module
- delta - delta
bypass: true
map: map:
filter: filter:
- filter_html - filter_html
......
...@@ -15,11 +15,16 @@ process: ...@@ -15,11 +15,16 @@ process:
key: '@id' key: '@id'
process: process:
id: id:
plugin: static_map # If the filter ID cannot be mapped, it will pass through unmodified
# because the bypass flag is set. When the user actually tries to
# view text through an invalid filter plugin, the filter system will
# fall back to filter_null and display a helpful error message.
plugin: filter_id
bypass: true bypass: true
source: name source: name
map: # No need to map anything -- filter plugin IDs haven't changed since
php_code: filter_null # Drupal 7.
map: { }
settings: settings:
plugin: filter_settings plugin: filter_settings
source: settings source: settings
......
<?php
namespace Drupal\filter\Plugin\migrate\process;
use Drupal\Component\Plugin\PluginManagerInterface;
use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
use Drupal\Core\StringTranslation\TranslationInterface;
use Drupal\migrate\MigrateExecutableInterface;
use Drupal\migrate\Plugin\migrate\process\StaticMap;
use Drupal\migrate\Plugin\MigrationInterface;
use Drupal\migrate\Row;
use Symfony\Component\DependencyInjection\ContainerInterface;
/**
* @MigrateProcessPlugin(
* id = "filter_id"
* )
*/
class FilterID extends StaticMap implements ContainerFactoryPluginInterface {
/**
* The filter plugin manager.
*
* @var \Drupal\Component\Plugin\PluginManagerInterface|\Drupal\Component\Plugin\FallbackPluginManagerInterface
*/
protected $filterManager;
/**
* FilterID constructor.
*
* @param array $configuration
* Plugin configuration.
* @param string $plugin_id
* The plugin ID.
* @param mixed $plugin_definition
* The plugin definition.
* @param \Drupal\Component\Plugin\PluginManagerInterface $filter_manager
* The filter plugin manager.
* @param TranslationInterface $translator
* (optional) The string translation service.
*/
public function __construct(array $configuration, $plugin_id, $plugin_definition, PluginManagerInterface $filter_manager, TranslationInterface $translator = NULL) {
parent::__construct($configuration, $plugin_id, $plugin_definition);
$this->filterManager = $filter_manager;
$this->stringTranslation = $translator;
}
/**
* {@inheritdoc}
*/
public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
return new static(
$configuration,
$plugin_id,
$plugin_definition,
$container->get('plugin.manager.filter'),
$container->get('string_translation')
);
}
/**
* {@inheritdoc}
*/
public function transform($value, MigrateExecutableInterface $migrate_executable, Row $row, $destination_property) {
$plugin_id = parent::transform($value, $migrate_executable, $row, $destination_property);
// If the static map is bypassed on failure, the returned plugin ID will be
// an array if $value was. Plugin IDs cannot be arrays, so flatten it before
// passing it into the filter manager.
if (is_array($plugin_id)) {
$plugin_id = implode(':', $plugin_id);
}
if ($this->filterManager->hasDefinition($plugin_id)) {
return $plugin_id;
}
else {
$fallback = $this->filterManager->getFallbackPluginId($plugin_id);
$message = $this->t('Filter @plugin_id could not be mapped to an existing filter plugin; defaulting to @fallback.', [
'@plugin_id' => $plugin_id,
'@fallback' => $fallback,
]);
$migrate_executable->saveMessage((string) $message, MigrationInterface::MESSAGE_WARNING);
return $fallback;
}
}
}