Skip to content
Snippets Groups Projects
Commit 9f6235f2 authored by dpi's avatar dpi
Browse files

Fixed compatibility with Drupal8-beta15

Breadcrumbs have new return value - https://www.drupal.org/node/2543936
Fixed tests which work with rendered local tasks and actions - https://www.drupal.org/node/2511508

All tests are back to green.
RNG is no longer compatible with beta14 and lower
Fixed #49
parent 996ae93c
No related branches found
No related tags found
No related merge requests found
......@@ -12,6 +12,7 @@ use Drupal\Core\StringTranslation\StringTranslationTrait;
use Drupal\Core\Routing\RouteMatchInterface;
use Drupal\rng\GroupInterface;
use Drupal\Core\Link;
use Drupal\Core\Breadcrumb\Breadcrumb;
/**
* Provides a breadcrumb builder for groups.
......@@ -40,7 +41,10 @@ class GroupBreadcrumbBuilder implements BreadcrumbBuilderInterface {
$links[] = new Link($event->label(), $event->urlInfo());
}
return $links;
$breadcrumb = new Breadcrumb();
return $breadcrumb
->setLinks($links)
->setCacheContexts(['route.name']);
}
}
\ No newline at end of file
......@@ -12,6 +12,7 @@ use Drupal\Core\StringTranslation\StringTranslationTrait;
use Drupal\Core\Routing\RouteMatchInterface;
use Drupal\rng\RegistrationInterface;
use Drupal\Core\Link;
use Drupal\Core\Breadcrumb\Breadcrumb;
/**
* Provides a breadcrumb builder for registrations.
......@@ -43,7 +44,10 @@ class RegistrationBreadcrumbBuilder implements BreadcrumbBuilderInterface {
$links[] = new Link($registration->label(), $registration->urlInfo());
}
return $links;
$breadcrumb = new Breadcrumb();
return $breadcrumb
->setLinks($links)
->setCacheContexts(['route.name']);
}
}
......@@ -12,6 +12,7 @@ use Drupal\Core\StringTranslation\StringTranslationTrait;
use Drupal\Core\Routing\RouteMatchInterface;
use Drupal\rng\RuleComponentInterface;
use Drupal\Core\Link;
use Drupal\Core\Breadcrumb\Breadcrumb;
/**
* Provides a breadcrumb builder for RNG rule components.
......@@ -40,7 +41,11 @@ class RuleComponentBreadcrumbBuilder implements BreadcrumbBuilderInterface {
$links[] = new Link($event->label(), $event->urlInfo());
}
}
return $links;
$breadcrumb = new Breadcrumb();
return $breadcrumb
->setLinks($links)
->setCacheContexts(['route.name']);
}
}
\ No newline at end of file
......@@ -18,6 +18,7 @@ use Drupal\Core\Entity\EntityInterface;
use Drupal\courier\TemplateCollectionInterface;
use Drupal\rng\Plugin\Action\CourierTemplateCollection;
use Drupal\Core\Link;
use Drupal\Core\Breadcrumb\Breadcrumb;
/**
* Provides a breadcrumb builder for templates related to an event.
......@@ -156,7 +157,10 @@ class TemplateBreadcrumbBuilder implements BreadcrumbBuilderInterface {
$links[] = new Link($template->getEntityType()->getLabel(), $urlInfo);
}
return $links;
$breadcrumb = new Breadcrumb();
return $breadcrumb
->setLinks($links)
->setCacheContexts(['route.name']);
}
}
\ No newline at end of file
......@@ -7,8 +7,6 @@
namespace Drupal\rng\Tests;
use Drupal\Core\Url;
/**
* Tests event settings page.
*
......@@ -16,6 +14,14 @@ use Drupal\Core\Url;
*/
class EventSettingsTest extends RNGSiteTestBase {
public static $modules = ['block'];
protected function setUp() {
parent::setUp();
$this->drupalPlaceBlock('local_tasks_block');
$this->drupalPlaceBlock('local_actions_block');
}
/**
* Create two bundles of the same entity type, one bundle is an event type.
*
......
......@@ -19,7 +19,13 @@ use Drupal\Core\Url;
*/
class EventTypeTest extends RNGTestBase {
public static $modules = array('node', 'field_ui');
public static $modules = ['node', 'field_ui', 'block'];
protected function setUp() {
parent::setUp();
$this->drupalPlaceBlock('local_tasks_block');
$this->drupalPlaceBlock('local_actions_block');
}
function testEventType() {
$web_user = $this->drupalCreateUser(['administer event types', 'access administration pages']);
......
......@@ -19,6 +19,8 @@ use Drupal\rng\EventManagerInterface;
*/
class RegistrationTypeTest extends RNGSiteTestBase {
public static $modules = ['block'];
/**
* @var \Drupal\Core\Entity\EntityInterface
*/
......@@ -37,6 +39,9 @@ class RegistrationTypeTest extends RNGSiteTestBase {
$this->event = $this->createEntity($this->event_bundle, [
'uid' => \Drupal::currentUser()->id()
]);
$this->drupalPlaceBlock('local_tasks_block');
$this->drupalPlaceBlock('local_actions_block');
}
function testRegistrationTypes() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment