Update to Drupal 8.0.0-beta15. For more information, see: https://www.drupal.org/node/2563023
This commit is contained in:
parent
2720a9ec4b
commit
f3791f1da3
1898 changed files with 54300 additions and 11481 deletions
|
@ -8,6 +8,7 @@
|
|||
namespace Drupal\forum\Breadcrumb;
|
||||
|
||||
use Drupal\Core\Breadcrumb\BreadcrumbBuilderInterface;
|
||||
use Drupal\Core\Breadcrumb\Breadcrumb;
|
||||
use Drupal\Core\Config\ConfigFactoryInterface;
|
||||
use Drupal\Core\Entity\EntityManagerInterface;
|
||||
use Drupal\Core\Link;
|
||||
|
@ -65,14 +66,18 @@ abstract class ForumBreadcrumbBuilderBase implements BreadcrumbBuilderInterface
|
|||
* {@inheritdoc}
|
||||
*/
|
||||
public function build(RouteMatchInterface $route_match) {
|
||||
$breadcrumb[] = Link::createFromRoute($this->t('Home'), '<front>');
|
||||
$breadcrumb = new Breadcrumb();
|
||||
$breadcrumb->setCacheContexts(['route']);
|
||||
|
||||
$links[] = Link::createFromRoute($this->t('Home'), '<front>');
|
||||
|
||||
$vocabulary = $this->entityManager
|
||||
->getStorage('taxonomy_vocabulary')
|
||||
->load($this->config->get('vocabulary'));
|
||||
$breadcrumb[] = Link::createFromRoute($vocabulary->label(), 'forum.index');
|
||||
$breadcrumb->addCacheableDependency($vocabulary);
|
||||
$links[] = Link::createFromRoute($vocabulary->label(), 'forum.index');
|
||||
|
||||
return $breadcrumb;
|
||||
return $breadcrumb->setLinks($links);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -27,19 +27,26 @@ class ForumListingBreadcrumbBuilder extends ForumBreadcrumbBuilderBase {
|
|||
*/
|
||||
public function build(RouteMatchInterface $route_match) {
|
||||
$breadcrumb = parent::build($route_match);
|
||||
$breadcrumb->addCacheContexts(['route']);
|
||||
|
||||
// Add all parent forums to breadcrumbs.
|
||||
$term_id = $route_match->getParameter('taxonomy_term')->id();
|
||||
/** @var \Drupal\Taxonomy\TermInterface $term */
|
||||
$term = $route_match->getParameter('taxonomy_term');
|
||||
$term_id = $term->id();
|
||||
$breadcrumb->addCacheableDependency($term);
|
||||
|
||||
$parents = $this->forumManager->getParents($term_id);
|
||||
if ($parents) {
|
||||
foreach (array_reverse($parents) as $parent) {
|
||||
if ($parent->id() != $term_id) {
|
||||
$breadcrumb[] = Link::createFromRoute($parent->label(), 'forum.page', array(
|
||||
$breadcrumb->addCacheableDependency($parent);
|
||||
$breadcrumb->addLink(Link::createFromRoute($parent->label(), 'forum.page', [
|
||||
'taxonomy_term' => $parent->id(),
|
||||
));
|
||||
]));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $breadcrumb;
|
||||
}
|
||||
|
||||
|
|
|
@ -29,18 +29,21 @@ class ForumNodeBreadcrumbBuilder extends ForumBreadcrumbBuilderBase {
|
|||
*/
|
||||
public function build(RouteMatchInterface $route_match) {
|
||||
$breadcrumb = parent::build($route_match);
|
||||
$breadcrumb->addCacheContexts(['route']);
|
||||
|
||||
$parents = $this->forumManager->getParents($route_match->getParameter('node')->forum_tid);
|
||||
if ($parents) {
|
||||
$parents = array_reverse($parents);
|
||||
foreach ($parents as $parent) {
|
||||
$breadcrumb[] = Link::createFromRoute($parent->label(), 'forum.page',
|
||||
$breadcrumb->addCacheableDependency($parent);
|
||||
$breadcrumb->addLink(Link::createFromRoute($parent->label(), 'forum.page',
|
||||
array(
|
||||
'taxonomy_term' => $parent->id(),
|
||||
)
|
||||
);
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
return $breadcrumb;
|
||||
}
|
||||
|
||||
|
|
|
@ -190,6 +190,7 @@ class ForumController extends ControllerBase {
|
|||
else {
|
||||
// Set the page title to forum's vocabulary name.
|
||||
$build['#title'] = $vocabulary->label();
|
||||
$this->renderer->addCacheableDependency($build, $vocabulary);
|
||||
}
|
||||
return $build;
|
||||
}
|
||||
|
|
|
@ -115,6 +115,7 @@ class ForumTest extends WebTestBase {
|
|||
'access comments',
|
||||
));
|
||||
$this->drupalPlaceBlock('help_block', array('region' => 'help'));
|
||||
$this->drupalPlaceBlock('local_actions_block');
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -235,6 +236,7 @@ class ForumTest extends WebTestBase {
|
|||
|
||||
// Test the root forum page title change.
|
||||
$this->drupalGet('forum');
|
||||
$this->assertCacheTag('config:taxonomy.vocabulary.' . $this->forum['vid']);
|
||||
$this->assertTitle(t('Forums | Drupal'));
|
||||
$vocabulary = Vocabulary::load($this->forum['vid']);
|
||||
$vocabulary->set('name', 'Discussions');
|
||||
|
|
|
@ -13,7 +13,7 @@ use Drupal\migrate_drupal\Tests\d6\MigrateDrupal6TestBase;
|
|||
/**
|
||||
* Upgrade variables to forum.settings.yml.
|
||||
*
|
||||
* @group forum
|
||||
* @group migrate_drupal_6
|
||||
*/
|
||||
class MigrateForumConfigsTest extends MigrateDrupal6TestBase {
|
||||
|
||||
|
@ -36,7 +36,6 @@ class MigrateForumConfigsTest extends MigrateDrupal6TestBase {
|
|||
array(array(1), array('vocabulary_1_i_0_')),
|
||||
)
|
||||
));
|
||||
$this->loadDumps(['Variable.php']);
|
||||
$this->executeMigration('d6_forum_settings');
|
||||
}
|
||||
|
||||
|
|
Reference in a new issue