Update to drupal 8.0.0-rc1. For more information, see https://www.drupal.org/node/2582663
This commit is contained in:
parent
eb34d130a8
commit
f32e58e4b1
8476 changed files with 211648 additions and 170042 deletions
|
@ -8,7 +8,7 @@
|
|||
namespace Drupal\options\Plugin\Field\FieldFormatter;
|
||||
|
||||
use Drupal\Core\Field\AllowedTagsXssTrait;
|
||||
use Drupal\Core\Field\FieldFilteredString;
|
||||
use Drupal\Core\Field\FieldFilteredMarkup;
|
||||
use Drupal\Core\Field\FormatterBase;
|
||||
use Drupal\Core\Field\FieldItemListInterface;
|
||||
use Drupal\Core\Form\OptGroup;
|
||||
|
@ -33,7 +33,7 @@ class OptionsDefaultFormatter extends FormatterBase {
|
|||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function viewElements(FieldItemListInterface $items) {
|
||||
public function viewElements(FieldItemListInterface $items, $langcode) {
|
||||
$elements = array();
|
||||
|
||||
// Only collect allowed options if there are actually items to display.
|
||||
|
@ -51,7 +51,7 @@ class OptionsDefaultFormatter extends FormatterBase {
|
|||
$output = isset($options[$value]) ? $options[$value] : $value;
|
||||
$elements[$delta] = array(
|
||||
'#markup' => $output,
|
||||
'#allowed_tags' => FieldFilteredString::allowedTags(),
|
||||
'#allowed_tags' => FieldFilteredMarkup::allowedTags(),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
namespace Drupal\options\Plugin\Field\FieldFormatter;
|
||||
|
||||
use Drupal\Core\Field\AllowedTagsXssTrait;
|
||||
use Drupal\Core\Field\FieldFilteredString;
|
||||
use Drupal\Core\Field\FieldFilteredMarkup;
|
||||
use Drupal\Core\Field\FormatterBase;
|
||||
use Drupal\Core\Field\FieldItemListInterface;
|
||||
|
||||
|
@ -32,13 +32,13 @@ class OptionsKeyFormatter extends FormatterBase {
|
|||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function viewElements(FieldItemListInterface $items) {
|
||||
public function viewElements(FieldItemListInterface $items, $langcode) {
|
||||
$elements = array();
|
||||
|
||||
foreach ($items as $delta => $item) {
|
||||
$elements[$delta] = array(
|
||||
'#markup' => $item->value,
|
||||
'#allowed_tags' => FieldFilteredString::allowedTags(),
|
||||
'#allowed_tags' => FieldFilteredMarkup::allowedTags(),
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -7,9 +7,8 @@
|
|||
|
||||
namespace Drupal\options\Plugin\views\argument;
|
||||
|
||||
use Drupal\Component\Utility\SafeMarkup;
|
||||
use Drupal\Core\Field\AllowedTagsXssTrait;
|
||||
use Drupal\Core\Field\FieldFilteredString;
|
||||
use Drupal\Core\Field\FieldFilteredMarkup;
|
||||
use Drupal\Core\Form\FormStateInterface;
|
||||
use Drupal\views\FieldAPIHandlerTrait;
|
||||
use Drupal\views\ViewExecutable;
|
||||
|
@ -81,11 +80,11 @@ class NumberListField extends NumericArgument {
|
|||
$value = $data->{$this->name_alias};
|
||||
// If the list element has a human readable name show it.
|
||||
if (isset($this->allowedValues[$value]) && !empty($this->options['summary']['human'])) {
|
||||
return FieldFilteredString::create($this->allowedValues[$value]);
|
||||
return FieldFilteredMarkup::create($this->allowedValues[$value]);
|
||||
}
|
||||
// Else, fallback to the key.
|
||||
else {
|
||||
return SafeMarkup::checkPlain($value);
|
||||
return $value;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
namespace Drupal\options\Plugin\views\argument;
|
||||
|
||||
use Drupal\Core\Field\AllowedTagsXssTrait;
|
||||
use Drupal\Core\Field\FieldFilteredString;
|
||||
use Drupal\Core\Field\FieldFilteredMarkup;
|
||||
use Drupal\Core\Form\FormStateInterface;
|
||||
use Drupal\views\FieldAPIHandlerTrait;
|
||||
use Drupal\views\ViewExecutable;
|
||||
|
@ -83,7 +83,7 @@ class StringListField extends StringArgument {
|
|||
if (isset($this->allowedValues[$value]) && !empty($this->options['summary']['human'])) {
|
||||
$value = $this->allowedValues[$value];
|
||||
}
|
||||
return FieldFilteredString::create($this->caseTransform($value, $this->options['case']));
|
||||
return FieldFilteredMarkup::create($this->caseTransform($value, $this->options['case']));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -326,7 +326,7 @@ class OptionsFieldUITest extends FieldTestBase {
|
|||
);
|
||||
|
||||
$this->drupalPostForm($this->adminPath, $edit, t('Save field settings'));
|
||||
$this->assertText(format_string('Updated field !field_name field settings.', array('!field_name' => $this->fieldName)), "The 'On' and 'Off' form fields work for boolean fields.");
|
||||
$this->assertText(format_string('Updated field @field_name field settings.', array('@field_name' => $this->fieldName)), "The 'On' and 'Off' form fields work for boolean fields.");
|
||||
|
||||
// Select a default value.
|
||||
$edit = array(
|
||||
|
|
|
@ -48,8 +48,8 @@ class OptionsFloatFieldImportTest extends FieldTestBase {
|
|||
|
||||
$admin_path = 'admin/structure/types/manage/' . $type . '/fields/node.' . $type . '.' . $field_name . '/storage';
|
||||
|
||||
// Export active config to staging
|
||||
$this->copyConfig($this->container->get('config.storage'), $this->container->get('config.storage.staging'));
|
||||
// Export active config to sync.
|
||||
$this->copyConfig($this->container->get('config.storage'), $this->container->get('config.storage.sync'));
|
||||
|
||||
// Set the active to not use dots in the allowed values key names.
|
||||
$edit = array('settings[allowed_values]' => "0|Zero\n1|One");
|
||||
|
|
|
@ -11,8 +11,8 @@ namespace Drupal\options\Tests;
|
|||
* Tests the Options field type formatters.
|
||||
*
|
||||
* @group options
|
||||
* @see \Drupal\options\Plugin\field\formatter\OptionsDefaultFormatter
|
||||
* @see \Drupal\options\Plugin\field\formatter\OptionsKeyFormatter
|
||||
* @see \Drupal\options\Plugin\Field\FieldFormatter\OptionsDefaultFormatter
|
||||
* @see \Drupal\options\Plugin\Field\FieldFormatter\OptionsKeyFormatter
|
||||
*/
|
||||
class OptionsFormattersTest extends OptionsFieldUnitTestBase {
|
||||
|
||||
|
|
|
@ -269,7 +269,7 @@ class OptionsWidgetsTest extends FieldTestBase {
|
|||
// Submit form: select invalid 'none' option.
|
||||
$edit = array('card_1' => '_none');
|
||||
$this->drupalPostForm(NULL, $edit, t('Save'));
|
||||
$this->assertRaw(t('!title field is required.', array('!title' => $field->getName())), 'Cannot save a required field when selecting "none" from the select list.');
|
||||
$this->assertRaw(t('@title field is required.', array('@title' => $field->getName())), 'Cannot save a required field when selecting "none" from the select list.');
|
||||
|
||||
// Submit form: select first option.
|
||||
$edit = array('card_1' => 0);
|
||||
|
|
Reference in a new issue