Skip to content
Snippets Groups Projects
Commit 26b531bf authored by ekes's avatar ekes
Browse files

Issue #3427637: Fix multiple occurrence field paths.

Initial version would have the same path for different routes. Routes
named by field storage config id (entity_type_id.field_machine_name) but
the path would be the same for different field_machine_names, thus only
one getting chosen over the others.
parent dac728e5
No related branches found
No related tags found
No related merge requests found
......@@ -39,37 +39,36 @@ class RouteSubscriber implements EventSubscriberInterface {
->getStorage('field_storage_config')
->loadByProperties(['type' => 'date_occur_parent']);
$entity_types = [];
foreach ($fields as $field) {
assert($field instanceof FieldStorageConfigInterface);
$entity_types[$field->id()] = $field->getTargetEntityTypeId();
}
$entity_type_id = $field->getTargetEntityTypeId();
$field_machine_name = $field->getName();
$field_id = $field->id();
foreach ($entity_types as $field_id => $entity_type) {
if ($route = $collection->get('entity.' . $entity_type . '.canonical')) {
if ($route = $collection->get('entity.' . $entity_type_id . '.canonical')) {
$path = $route->getPath();
$date_route = clone $route;
$date_route->setPath($path . '/date_occur/{date_occur}');
$date_route->setPath($path . '/date_occur/' . $field_machine_name . '/{date_occur}');
$parameters = (array) $date_route->getOption('parameters');
$parameters += [
'date_occur' => [
'type' => 'date_occur:' . $field_id,
'entity_param' => $entity_type,
'entity_param' => $entity_type_id,
],
];
$date_route->setOption('parameters', $parameters);
$collection->add('date_occur_ui.' . $field_id . '.view', $date_route);
}
// For convenience and not to confuse UI duplicate edit form.
if ($route = $collection->get('entity.' . $entity_type . '.edit_form')) {
if ($route = $collection->get('entity.' . $entity_type_id . '.edit_form')) {
$path = $route->getPath();
$date_route = clone $route;
$date_route->setPath($path . '/date_occur/{date_occur}/edit-all');
$date_route->setPath($path . '/date_occur/' . $field_machine_name . '/{date_occur}/edit-all');
$parameters = (array) $date_route->getOption('parameters');
$parameters += [
'date_occur' => [
'type' => 'date_occur:' . $field_id,
'entity_param' => $entity_type,
'entity_param' => $entity_type_id,
],
];
$date_route->setOption('parameters', $parameters);
......
......@@ -39,28 +39,27 @@ class Routes {
->getStorage('field_storage_config')
->loadByProperties(['type' => 'date_occur_parent']);
$entity_types = [];
foreach ($fields as $field) {
assert($field instanceof FieldStorageConfigInterface);
$entity_types[$field->id()] = $field->getTargetEntityTypeId();
}
$entity_type_id = $field->getTargetEntityTypeId();
$field_machine_name = $field->getName();
$field_id = $field->id();
foreach ($entity_types as $field_id => $entity_type) {
$route = new Route(
'/' . $entity_type . '/{' . $entity_type . '}/date_occur/{date_occur}/create',
'/' . $entity_type_id . '/{' . $entity_type_id . '}/date_occur/' . $field_machine_name . '/{date_occur}/create',
[
'_controller' => 'date_occur_ui.create_form:getContentResult',
// @todo _title_callback
],
[
'_entity_access' => $entity_type . '.update',
'_entity_access' => $entity_type_id . '.update',
],
[
'parameters' => [
$entity_type => ['type' => 'entity:' . $entity_type],
$entity_type_id => ['type' => 'entity:' . $entity_type_id],
'date_occur' => [
'type' => 'date_occur:' . $field_id,
'entity_param' => $entity_type,
'entity_param' => $entity_type_id,
],
],
'_date_occur_operation_route' => TRUE,
......@@ -72,20 +71,20 @@ class Routes {
);
$route = new Route(
'/' . $entity_type . '/{' . $entity_type . '}/date_occur/{date_occur}/edit-future',
'/' . $entity_type_id . '/{' . $entity_type_id . '}/date_occur/' . $field_machine_name . '/{date_occur}/edit-future',
[
'_controller' => 'date_occur_ui.recur_edit_form:editFutureForm',
// @todo _title_callback
],
[
'_entity_access' => $entity_type . '.update',
'_entity_access' => $entity_type_id . '.update',
],
[
'parameters' => [
$entity_type => ['type' => 'entity:' . $entity_type],
$entity_type_id => ['type' => 'entity:' . $entity_type_id],
'date_occur' => [
'type' => 'date_occur:' . $field_id,
'entity_param' => $entity_type,
'entity_param' => $entity_type_id,
],
],
'_date_occur_operation_route' => TRUE,
......
......@@ -5,7 +5,7 @@ namespace Drupal\Tests\date_occur_ui\Functional;
use Drupal\Tests\date_occur\Functional\FieldFormatterTest;
/**
* Recur and Occur field formatters.
* Recur and Occur field formatters.
*
* @group date_occur
*/
......@@ -60,7 +60,7 @@ class FieldFormattersTest extends FieldFormatterTest {
* Date occur recur formatter timezones.
*/
public function testTimezoneFormatter() {
$this->drupalGet('/entity_test/' . $this->entity->id() . '/date_occur/2008-06-17T22:00:00Z--2008-06-18T06:00:00Z');
$this->drupalGet('/entity_test/' . $this->entity->id() . '/date_occur/date_parent_field/2008-06-17T22:00:00Z--2008-06-18T06:00:00Z');
// Occurrence.
$time = $this->getSession()->getPage()->find('xpath', "//div[@class='date-recur-date']/time[@datetime='2008-06-18T05:00:00+07:00']");
$this->assertEquals('2008-06-18T08:00:00+1000', $time->getHtml());
......@@ -71,12 +71,12 @@ class FieldFormattersTest extends FieldFormatterTest {
$this->assertEquals('2008-06-19T08:00:00+1000', $time->getHtml());
$time = $this->getSession()->getPage()->find('xpath', "//time[@datetime='2008-06-19T13:00:00+07:00']");
$this->assertEquals('2008-06-19T16:00:00+1000', $time->getHtml());
// Switch to display in original timezone.
$display_options = $this->viewDisplay->getComponent('date_recur_field');
$display_options['settings']['timezone_override'] = 'date_timezone';
$this->viewDisplay->setComponent('date_recur_field', $display_options)->save();
$this->drupalGet('/entity_test/' . $this->entity->id() . '/date_occur/2008-06-17T22:00:00Z--2008-06-18T06:00:00Z');
$this->drupalGet('/entity_test/' . $this->entity->id() . '/date_occur/date_parent_field/2008-06-17T22:00:00Z--2008-06-18T06:00:00Z');
// Occurrence.
$time = $this->getSession()->getPage()->find('xpath', "//div[@class='date-recur-date']/time[@datetime='2008-06-18T05:00:00+07:00']");
$this->assertEquals('2008-06-18T05:00:00+0700', $time->getHtml());
......@@ -99,7 +99,7 @@ class FieldFormattersTest extends FieldFormatterTest {
$this->viewDisplay->setComponent('date_recur_field', $display_options)->save();
// Cache the list on a date.
$this->drupalGet('/entity_test/' . $this->entity->id() . '/date_occur/2008-06-15T22:00:00Z--2008-06-16T06:00:00Z');
$this->drupalGet('/entity_test/' . $this->entity->id() . '/date_occur/date_parent_field/2008-06-15T22:00:00Z--2008-06-16T06:00:00Z');
// Date.
$time = $this->getSession()->getPage()->find('xpath', "//time[@datetime='2008-06-16T05:00:00+07:00']");
$this->assertEquals('2008-06-16T08:00:00+1000', $time->getHtml());
......@@ -110,15 +110,15 @@ class FieldFormattersTest extends FieldFormatterTest {
$this->assertEquals('2008-06-17T08:00:00+1000', $time->getHtml());
$time = $this->getSession()->getPage()->find('xpath', "//time[@datetime='2008-06-17T13:00:00+07:00']");
$this->assertEquals('2008-06-17T16:00:00+1000', $time->getHtml());
$this->assertSession()->linkByHrefExists('/entity_test/1/date_occur/2008-06-16T22%3A00%3A00Z--2008-06-17T06%3A00%3A00Z');
$this->assertSession()->linkByHrefExists('/entity_test/1/date_occur/date_parent_field/2008-06-16T22%3A00%3A00Z--2008-06-17T06%3A00%3A00Z');
$time = $this->getSession()->getPage()->find('xpath', "//time[@datetime='2008-06-18T05:00:00+07:00']");
$this->assertEquals('2008-06-18T08:00:00+1000', $time->getHtml());
$time = $this->getSession()->getPage()->find('xpath', "//time[@datetime='2008-06-18T13:00:00+07:00']");
$this->assertEquals('2008-06-18T16:00:00+1000', $time->getHtml());
$this->assertSession()->linkByHrefExists('/entity_test/1/date_occur/2008-06-17T22%3A00%3A00Z--2008-06-18T06%3A00%3A00Z');
$this->assertSession()->linkByHrefExists('/entity_test/1/date_occur/date_parent_field/2008-06-17T22%3A00%3A00Z--2008-06-18T06%3A00%3A00Z');
// Change date in the argument.
$this->drupalGet('/entity_test/' . $this->entity->id() . '/date_occur/2008-06-17T22:00:00Z--2008-06-18T06:00:00Z');
$this->drupalGet('/entity_test/' . $this->entity->id() . '/date_occur/date_parent_field/2008-06-17T22:00:00Z--2008-06-18T06:00:00Z');
// Date.
$time = $this->getSession()->getPage()->find('xpath', "//time[@datetime='2008-06-18T05:00:00+07:00']");
$this->assertEquals('2008-06-18T08:00:00+1000', $time->getHtml());
......@@ -129,22 +129,22 @@ class FieldFormattersTest extends FieldFormatterTest {
$this->assertEquals('2008-06-19T08:00:00+1000', $time->getHtml());
$time = $this->getSession()->getPage()->find('xpath', "//time[@datetime='2008-06-19T13:00:00+07:00']");
$this->assertEquals('2008-06-19T16:00:00+1000', $time->getHtml());
$this->assertSession()->linkByHrefExists('/entity_test/1/date_occur/2008-06-18T22%3A00%3A00Z--2008-06-19T06%3A00%3A00Z');
$this->assertSession()->linkByHrefExists('/entity_test/1/date_occur/date_parent_field/2008-06-18T22%3A00%3A00Z--2008-06-19T06%3A00%3A00Z');
$time = $this->getSession()->getPage()->find('xpath', "//time[@datetime='2008-06-20T05:00:00+07:00']");
$this->assertEquals('2008-06-20T08:00:00+1000', $time->getHtml());
$time = $this->getSession()->getPage()->find('xpath', "//time[@datetime='2008-06-20T13:00:00+07:00']");
$this->assertEquals('2008-06-20T16:00:00+1000', $time->getHtml());
$this->assertSession()->linkByHrefExists('/entity_test/1/date_occur/2008-06-19T22%3A00%3A00Z--2008-06-20T06%3A00%3A00Z');
$this->assertSession()->linkByHrefExists('/entity_test/1/date_occur/date_parent_field/2008-06-19T22%3A00%3A00Z--2008-06-20T06%3A00%3A00Z');
$override = $this->createOverride();
$this->drupalGet('/entity_test/' . $this->entity->id() . '/date_occur/2008-06-17T22:00:00Z--2008-06-18T06:00:00Z');
$this->drupalGet('/entity_test/' . $this->entity->id() . '/date_occur/date_parent_field/2008-06-17T22:00:00Z--2008-06-18T06:00:00Z');
// Not overriden occurrence.
$time = $this->getSession()->getPage()->find('xpath', "//time[@datetime='2008-06-19T05:00:00+07:00']");
$this->assertEquals('2008-06-19T08:00:00+1000', $time->getHtml());
$time = $this->getSession()->getPage()->find('xpath', "//time[@datetime='2008-06-19T13:00:00+07:00']");
$this->assertEquals('2008-06-19T16:00:00+1000', $time->getHtml());
$this->assertSession()->linkByHrefExists('/entity_test/1/date_occur/2008-06-18T22%3A00%3A00Z--2008-06-19T06%3A00%3A00Z');
$this->assertSession()->linkByHrefExists('/entity_test/1/date_occur/date_parent_field/2008-06-18T22%3A00%3A00Z--2008-06-19T06%3A00%3A00Z');
// Overriden occurrence.
$time = $this->getSession()->getPage()->find('xpath', "//time[@datetime='2008-06-20T05:00:00+07:00']");
$this->assertEquals('2008-06-20T08:00:00+1000', $time->getHtml());
......@@ -152,7 +152,7 @@ class FieldFormattersTest extends FieldFormatterTest {
$this->assertEquals('2008-06-20T16:00:00+1000', $time->getHtml());
// As mentioned in the code changing the URL is less important. But it does
// show the the cache is updated when override is added.
$this->assertSession()->linkByHrefNotExists('/entity_test/1/date_occur/2008-06-19T22%3A00%3A00Z--2008-06-20T06%3A00%3A00Z');
$this->assertSession()->linkByHrefNotExists('/entity_test/1/date_occur/date_parent_field/2008-06-19T22%3A00%3A00Z--2008-06-20T06%3A00%3A00Z');
$this->assertSession()->linkByHrefExists('/entity_test/2');
// Change time on override check cache.
......@@ -162,7 +162,7 @@ class FieldFormattersTest extends FieldFormatterTest {
'timezone' => $this->timezone,
];
$override->save();
$this->drupalGet('/entity_test/' . $this->entity->id() . '/date_occur/2008-06-18T22:00:00Z--2008-06-19T06:00:00Z');
$this->drupalGet('/entity_test/' . $this->entity->id() . '/date_occur/date_parent_field/2008-06-18T22:00:00Z--2008-06-19T06:00:00Z');
// Not overriden occurrence.
$time = $this->getSession()->getPage()->find('xpath', "//time[@datetime='2008-06-19T05:00:00+07:00']");
$this->assertEquals('2008-06-19T08:00:00+1000', $time->getHtml());
......@@ -209,13 +209,13 @@ class FieldFormattersTest extends FieldFormatterTest {
* @todo move this somewhere more appropriate.
*/
public function testUpcasting() {
$this->drupalGet('/entity_test/' . $this->entity->id() . '/date_occur/2008-06-17T22:00:00Z--2008-06-18T06:00:00Z');
$this->drupalGet('/entity_test/' . $this->entity->id() . '/date_occur/date_parent_field/2008-06-17T22:00:00Z--2008-06-18T06:00:00Z');
$this->assertSession()->statusCodeEquals(200);
// No existing.
$this->drupalGet('/entity_test/' . $this->entity->id() . '/date_occur/2008-06-17T21:00:00Z--2008-06-18T06:00:00Z');
$this->drupalGet('/entity_test/' . $this->entity->id() . '/date_occur/date_parent_field/2008-06-17T21:00:00Z--2008-06-18T06:00:00Z');
$this->assertSession()->statusCodeEquals(404);
// Misformed.
$this->drupalGet('/entity_test/' . $this->entity->id() . '/date_occur/2008-06-17T22:00:00--2008-06-18T06:00:00');
$this->drupalGet('/entity_test/' . $this->entity->id() . '/date_occur/date_parent_field/2008-06-17T22:00:00--2008-06-18T06:00:00');
$this->assertSession()->statusCodeEquals(404);
}
......
......@@ -96,11 +96,11 @@ class InstanceCreateRouteTest extends BrowserTestBase {
$fieldConfig = FieldConfig::create($field);
$fieldConfig->save();
$routes = \Drupal::service('router.route_provider')->getRoutesByPattern('/entity_test/%/date_occur/%/create');
$routes = \Drupal::service('router.route_provider')->getRoutesByPattern('/entity_test/%/date_occur/date_parent_field/%/create');
assert($routes instanceof RouteCollection);
$this->assertCount(1, $routes);
$route = \Drupal::service('router.route_provider')->getRouteByName('date_occur_ui.entity_test.date_parent_field.create');
$this->assertEquals('/entity_test/{entity_test}/date_occur/{date_occur}/create', $route->getPath());
$this->assertEquals('/entity_test/{entity_test}/date_occur/date_parent_field/{date_occur}/create', $route->getPath());
// Create user with access.
$edit_user = $this->drupalCreateUser([
......@@ -126,27 +126,27 @@ class InstanceCreateRouteTest extends BrowserTestBase {
];
$entity->save();
$this->drupalGet('/entity_test/' . $entity->id() . '/date_occur/2022-06-05T22:00:00+00:00--2022-06-06T06:00:00+00:00/create');
$this->drupalGet('/entity_test/' . $entity->id() . '/date_occur/date_parent_field/2022-06-05T22:00:00+00:00--2022-06-06T06:00:00+00:00/create');
$this->assertSession()->statusCodeEquals(200);
// Create user without access.
$other_user = $this->drupalCreateUser();
$this->drupalLogin($other_user);
$this->drupalGet('/entity_test/' . $entity->id() . '/date_occur/2022-06-05T22:00:00+00:00--2022-06-06T06:00:00+00:00/create');
$this->drupalGet('/entity_test/' . $entity->id() . '/date_occur/date_parent_field/2022-06-05T22:00:00+00:00--2022-06-06T06:00:00+00:00/create');
$this->assertSession()->statusCodeEquals(403);
// Edit user, but date not in sequence.
$this->drupalLogin($edit_user);
$this->drupalGet('/entity_test/' . $entity->id() . '/date_occur/2022-06-06T22:00:00+00:00--2022-06-07T06:00:00+00:00/create');
$this->drupalGet('/entity_test/' . $entity->id() . '/date_occur/date_parent_field/2022-06-06T22:00:00+00:00--2022-06-07T06:00:00+00:00/create');
$this->assertSession()->statusCodeEquals(404);
// Edit user, but date not in correct end.
$this->drupalGet('/entity_test/' . $entity->id() . '/date_occur/2022-06-05T22:00:00+00:00--2022-06-06T05:00:00+00:00/create');
$this->drupalGet('/entity_test/' . $entity->id() . '/date_occur/date_parent_field/2022-06-05T22:00:00+00:00--2022-06-06T05:00:00+00:00/create');
$this->assertSession()->statusCodeEquals(404);
// Edit user, but invalid date.
$this->drupalGet('/entity_test/' . $entity->id() . '/date_occur/2022-06-05--22:00:00T00:00--2022-06-06T05:00:00+00:00/create');
$this->drupalGet('/entity_test/' . $entity->id() . '/date_occur/date_parent_field/2022-06-05--22:00:00T00:00--2022-06-06T05:00:00+00:00/create');
$this->assertSession()->statusCodeEquals(404);
// Check form display mode switch.
......@@ -154,14 +154,14 @@ class InstanceCreateRouteTest extends BrowserTestBase {
$entity_display->setComponent('date_recur_field');
$entity_display->save();
$this->drupalGet('/entity_test/' . $entity->id() . '/date_occur/2022-06-05T22:00:00Z--2022-06-06T06:00:00Z/create');
$this->drupalGet('/entity_test/' . $entity->id() . '/date_occur/date_parent_field/2022-06-05T22:00:00Z--2022-06-06T06:00:00Z/create');
$this->assertSession()->statusCodeEquals(200);
$this->assertSession()->elementExists('css', 'input[name="date_recur_field[0][value][date]"]');
$entity_display->removeComponent('date_recur_field');
$entity_display->save();
$this->drupalGet('/entity_test/' . $entity->id() . '/date_occur/2022-06-05T22:00:00Z--2022-06-06T06:00:00Z/create');
$this->drupalGet('/entity_test/' . $entity->id() . '/date_occur/date_parent_field/2022-06-05T22:00:00Z--2022-06-06T06:00:00Z/create');
$this->assertSession()->statusCodeEquals(200);
$this->assertSession()->elementNotExists('css', 'input[name="date_recur_field[0][value][date]"]');
}
......
......@@ -117,7 +117,7 @@ class InstanceEditTest extends BrowserTestBase {
];
$entity->save();
$this->drupalGet('/entity_test/' . $entity->id() . '/date_occur/2008-06-16T22:00:00Z--2008-06-17T06:00:00Z/create');
$this->drupalGet('/entity_test/' . $entity->id() . '/date_occur/date_parent_field/2008-06-16T22:00:00Z--2008-06-17T06:00:00Z/create');
$this->assertSession()->statusCodeEquals(200);
$this->assertSession()->elementNotExists('css', 'input[name="date_recur_field[0][rrule]"]');
......
......@@ -115,13 +115,13 @@ class InstanceRedirectRouteTest extends BrowserTestBase {
$this->assertSession()->pageTextContains($parent_entity->label());
// Date that does not exist in the recurrence rule.
$this->drupalGet($parent_entity->toUrl()->toString() . '/date_occur/2022-06-02T22:00:00Z--2022-06-03T06:00:00Z');
$this->drupalGet($parent_entity->toUrl()->toString() . '/date_occur/date_parent_field/2022-06-02T22:00:00Z--2022-06-03T06:00:00Z');
$this->assertSession()->statusCodeEquals(404);
// Date that does exist in the recurrence rule.
$this->drupalGet($parent_entity->toUrl()->toString() . '/date_occur/2022-06-03T22:00:00Z--2022-06-04T06:00:00Z');
$this->drupalGet($parent_entity->toUrl()->toString() . '/date_occur/date_parent_field/2022-06-03T22:00:00Z--2022-06-04T06:00:00Z');
$this->assertSession()->statusCodeEquals(200);
$occurrence_url = $parent_entity->toUrl()->toString() . '/date_occur/' . urlencode('2022-06-03T22:00:00Z--2022-06-04T06:00:00Z');
$occurrence_url = $parent_entity->toUrl()->toString() . '/date_occur/date_parent_field/' . urlencode('2022-06-03T22:00:00Z--2022-06-04T06:00:00Z');
$this->assertSession()->addressEquals($occurrence_url);
$this->assertSession()->pageTextContains($parent_entity->label());
......@@ -150,14 +150,14 @@ class InstanceRedirectRouteTest extends BrowserTestBase {
$instance_entity->save();
// Check redirected to the instance now.
$this->drupalGet($parent_entity->toUrl()->toString() . '/date_occur/2022-06-03T22:00:00Z--2022-06-04T06:00:00Z');
$this->drupalGet($parent_entity->toUrl()->toString() . '/date_occur/date_parent_field/2022-06-03T22:00:00Z--2022-06-04T06:00:00Z');
$this->assertSession()->addressEquals($instance_entity->toUrl());
$this->assertSession()->pageTextContains($instance_entity->label());
$this->assertSession()->statusCodeEquals(200);
// Delete the instance, should be back to the occurrence.
$instance_entity->delete();
$this->drupalGet($parent_entity->toUrl()->toString() . '/date_occur/2022-06-03T22:00:00Z--2022-06-04T06:00:00Z');
$this->drupalGet($parent_entity->toUrl()->toString() . '/date_occur/date_parent_field/2022-06-03T22:00:00Z--2022-06-04T06:00:00Z');
$this->assertSession()->statusCodeEquals(200);
$this->assertSession()->addressEquals($occurrence_url);
$this->assertSession()->pageTextContains($parent_entity->label());
......
......@@ -117,7 +117,7 @@ class RecurUpdateTest extends BrowserTestBase {
];
$entity->save();
$this->drupalGet('/entity_test/' . $entity->id() . '/date_occur/2008-06-17T22:00:00Z--2008-06-18T06:00:00Z/edit-future');
$this->drupalGet('/entity_test/' . $entity->id() . '/date_occur/date_parent_field/2008-06-17T22:00:00Z--2008-06-18T06:00:00Z/edit-future');
$this->assertSession()->statusCodeEquals(200);
$this->assertSession()->fieldValueEquals('date_recur_field[0][value][date]', '2008-06-18');
......@@ -190,7 +190,7 @@ class RecurUpdateTest extends BrowserTestBase {
];
$override->save();
$this->drupalGet('/entity_test/' . $entity->id() . '/date_occur/2008-06-17T22:00:00Z--2008-06-18T06:00:00Z/edit-future');
$this->drupalGet('/entity_test/' . $entity->id() . '/date_occur/date_parent_field/2008-06-17T22:00:00Z--2008-06-18T06:00:00Z/edit-future');
$this->assertSession()->statusCodeEquals(200);
$this->assertSession()->fieldValueEquals('date_recur_field[0][value][date]', '2008-06-18');
......@@ -201,7 +201,7 @@ class RecurUpdateTest extends BrowserTestBase {
$page = $this->getSession()->getPage();
$page->pressButton('Save');
$this->assertSession()->addressEquals('/entity_test/' . $entity->id() . '/date_occur/' . urlencode('2008-06-17T22:00:00Z--2008-06-18T06:00:00Z') . '/edit-future');
$this->assertSession()->addressEquals('/entity_test/' . $entity->id() . '/date_occur/date_parent_field/' . urlencode('2008-06-17T22:00:00Z--2008-06-18T06:00:00Z') . '/edit-future');
$this->assertSession()->pageTextNotContains('Orphaned overrides');
$this->assertSession()->pageTextContains('Valid overrides');
......@@ -272,7 +272,7 @@ class RecurUpdateTest extends BrowserTestBase {
];
$override->save();
$this->drupalGet('/entity_test/' . $entity->id() . '/date_occur/2008-06-17T22:00:00Z--2008-06-18T06:00:00Z/edit-future');
$this->drupalGet('/entity_test/' . $entity->id() . '/date_occur/date_parent_field/2008-06-17T22:00:00Z--2008-06-18T06:00:00Z/edit-future');
$this->assertSession()->statusCodeEquals(200);
$this->assertSession()->fieldValueEquals('date_recur_field[0][value][date]', '2008-06-18');
......@@ -287,7 +287,7 @@ class RecurUpdateTest extends BrowserTestBase {
$page->fillField('date_recur_field[0][end_value][date]', '2008-06-18');
$page->fillField('date_recur_field[0][end_value][time]', '14:00:00');
$page->pressButton('Save');
$this->assertSession()->addressEquals('/entity_test/' . $entity->id() . '/date_occur/' . urlencode('2008-06-17T22:00:00Z--2008-06-18T06:00:00Z') . '/edit-future');
$this->assertSession()->addressEquals('/entity_test/' . $entity->id() . '/date_occur/date_parent_field/' . urlencode('2008-06-17T22:00:00Z--2008-06-18T06:00:00Z') . '/edit-future');
$this->assertSession()->pageTextContains('Orphaned overrides');
$this->assertSession()->pageTextNotContains('Valid overrides');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment