Update to drupal 8.0.0-rc1. For more information, see https://www.drupal.org/node/2582663

This commit is contained in:
Greg Anderson 2015-10-08 11:40:12 -07:00
parent eb34d130a8
commit f32e58e4b1
8476 changed files with 211648 additions and 170042 deletions

View file

@ -5,8 +5,6 @@
* Builds placeholder replacement tokens for taxonomy terms and vocabularies.
*/
use Drupal\Component\Utility\Html;
use Drupal\Component\Utility\Xss;
use Drupal\Core\Render\BubbleableMetadata;
use Drupal\taxonomy\Entity\Vocabulary;
@ -97,7 +95,6 @@ function taxonomy_tokens($type, $tokens, array $data, array $options, Bubbleable
$token_service = \Drupal::token();
$replacements = array();
$sanitize = !empty($options['sanitize']);
$taxonomy_storage = \Drupal::entityManager()->getStorage('taxonomy_term');
if ($type == 'term' && !empty($data['term'])) {
$term = $data['term'];
@ -109,11 +106,13 @@ function taxonomy_tokens($type, $tokens, array $data, array $options, Bubbleable
break;
case 'name':
$replacements[$original] = $sanitize ? Html::escape($term->getName()) : $term->getName();
$replacements[$original] = $term->getName();
break;
case 'description':
$replacements[$original] = $sanitize ? $term->description->processed : $term->getDescription();
// "processed" returns a \Drupal\Component\Render\MarkupInterface via
// check_markup().
$replacements[$original] = $term->description->processed;
break;
case 'url':
@ -131,14 +130,14 @@ function taxonomy_tokens($type, $tokens, array $data, array $options, Bubbleable
case 'vocabulary':
$vocabulary = Vocabulary::load($term->bundle());
$bubbleable_metadata->addCacheableDependency($vocabulary);
$replacements[$original] = Html::escape($vocabulary->label());
$replacements[$original] = $vocabulary->label();
break;
case 'parent':
if ($parents = $taxonomy_storage->loadParents($term->id())) {
$parent = array_pop($parents);
$bubbleable_metadata->addCacheableDependency($parent);
$replacements[$original] = Html::escape($parent->getName());
$replacements[$original] = $parent->getName();
}
break;
}
@ -165,11 +164,13 @@ function taxonomy_tokens($type, $tokens, array $data, array $options, Bubbleable
break;
case 'name':
$replacements[$original] = $sanitize ? Html::escape($vocabulary->label()) : $vocabulary->label();
$replacements[$original] = $vocabulary->label();
break;
case 'description':
$replacements[$original] = $sanitize ? Xss::filter($vocabulary->getDescription()) : $vocabulary->getDescription();
$build = ['#markup' => $vocabulary->getDescription()];
// @todo Fix in https://www.drupal.org/node/2577827
$replacements[$original] = \Drupal::service('renderer')->renderPlain($build);
break;
case 'term-count':