Update to Drupal 8.0.0-beta15. For more information, see: https://www.drupal.org/node/2563023

This commit is contained in:
Pantheon Automation 2015-09-04 13:20:09 -07:00 committed by Greg Anderson
parent 2720a9ec4b
commit f3791f1da3
1898 changed files with 54300 additions and 11481 deletions

View file

@ -8,6 +8,7 @@
namespace Drupal\options\Plugin\Field\FieldFormatter;
use Drupal\Core\Field\AllowedTagsXssTrait;
use Drupal\Core\Field\FieldFilteredString;
use Drupal\Core\Field\FormatterBase;
use Drupal\Core\Field\FieldItemListInterface;
use Drupal\Core\Form\OptGroup;
@ -48,7 +49,10 @@ class OptionsDefaultFormatter extends FormatterBase {
// If the stored value is in the current set of allowed values, display
// the associated label, otherwise just display the raw value.
$output = isset($options[$value]) ? $options[$value] : $value;
$elements[$delta] = array('#markup' => $this->fieldFilterXss($output));
$elements[$delta] = array(
'#markup' => $output,
'#allowed_tags' => FieldFilteredString::allowedTags(),
);
}
}

View file

@ -8,6 +8,7 @@
namespace Drupal\options\Plugin\Field\FieldFormatter;
use Drupal\Core\Field\AllowedTagsXssTrait;
use Drupal\Core\Field\FieldFilteredString;
use Drupal\Core\Field\FormatterBase;
use Drupal\Core\Field\FieldItemListInterface;
@ -35,7 +36,10 @@ class OptionsKeyFormatter extends FormatterBase {
$elements = array();
foreach ($items as $delta => $item) {
$elements[$delta] = array('#markup' => $this->fieldFilterXss($item->value));
$elements[$delta] = array(
'#markup' => $item->value,
'#allowed_tags' => FieldFilteredString::allowedTags(),
);
}
return $elements;

View file

@ -9,6 +9,7 @@ namespace Drupal\options\Plugin\views\argument;
use Drupal\Component\Utility\SafeMarkup;
use Drupal\Core\Field\AllowedTagsXssTrait;
use Drupal\Core\Field\FieldFilteredString;
use Drupal\Core\Form\FormStateInterface;
use Drupal\views\FieldAPIHandlerTrait;
use Drupal\views\ViewExecutable;
@ -80,7 +81,7 @@ 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 $this->fieldFilterXss($this->allowedValues[$value]);
return FieldFilteredString::create($this->allowedValues[$value]);
}
// Else, fallback to the key.
else {

View file

@ -8,6 +8,7 @@
namespace Drupal\options\Plugin\views\argument;
use Drupal\Core\Field\AllowedTagsXssTrait;
use Drupal\Core\Field\FieldFilteredString;
use Drupal\Core\Form\FormStateInterface;
use Drupal\views\FieldAPIHandlerTrait;
use Drupal\views\ViewExecutable;
@ -80,12 +81,9 @@ class StringListField extends StringArgument {
$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 $this->caseTransform($this->fieldFilterXss($this->allowedValues[$value]), $this->options['case']);
}
// Else, fallback to the key.
else {
return $this->caseTransform(SafeMarkup::checkPlain($value), $this->options['case']);
$value = $this->allowedValues[$value];
}
return FieldFilteredString::create($this->caseTransform($value, $this->options['case']));
}
}