diff --git a/core/modules/config/tests/config_events_test/src/EventSubscriber.php b/core/modules/config/tests/config_events_test/src/EventSubscriber.php index b127555..a15fabb 100644 --- a/core/modules/config/tests/config_events_test/src/EventSubscriber.php +++ b/core/modules/config/tests/config_events_test/src/EventSubscriber.php @@ -37,11 +37,13 @@ public function __construct(StateInterface $state) { * * @param \Drupal\Core\Config\ConfigCrudEvent $event * The configuration event. + * @param string $name + * The event name. */ - public function configEventRecorder(ConfigCrudEvent $event) { + public function configEventRecorder(ConfigCrudEvent $event, $name) { $config = $event->getConfig(); $this->state->set('config_events_test.event', array( - 'event_name' => $event->getName(), + 'event_name' => $name, 'current_config_data' => $config->get(), 'original_config_data' => $config->getOriginal(), 'raw_config_data' => $config->getRawData() diff --git a/core/modules/link/src/Plugin/Field/FieldWidget/LinkWidget.php b/core/modules/link/src/Plugin/Field/FieldWidget/LinkWidget.php index 7ed62ba..37a61ee 100644 --- a/core/modules/link/src/Plugin/Field/FieldWidget/LinkWidget.php +++ b/core/modules/link/src/Plugin/Field/FieldWidget/LinkWidget.php @@ -351,7 +351,7 @@ public function massageFormValues(array $values, array $form, FormStateInterface public function flagErrors(FieldItemListInterface $items, ConstraintViolationListInterface $violations, array $form, FormStateInterface $form_state) { /** @var \Symfony\Component\Validator\ConstraintViolationInterface $violation */ foreach ($violations as $offset => $violation) { - $parameters = $violation->getMessageParameters(); + $parameters = $violation->getParameters(); if (isset($parameters['@uri'])) { $parameters['@uri'] = static::getUriAsDisplayableString($parameters['@uri']); $violations->set($offset, new ConstraintViolation( @@ -361,7 +361,7 @@ public function flagErrors(FieldItemListInterface $items, ConstraintViolationLis $violation->getRoot(), $violation->getPropertyPath(), $violation->getInvalidValue(), - $violation->getMessagePluralization(), + $violation->getPlural(), $violation->getCode() )); } diff --git a/core/modules/rest/src/Plugin/ResourceBase.php b/core/modules/rest/src/Plugin/ResourceBase.php index 14bca5e..14ae62b 100644 --- a/core/modules/rest/src/Plugin/ResourceBase.php +++ b/core/modules/rest/src/Plugin/ResourceBase.php @@ -111,7 +111,7 @@ public function routes() { switch ($method) { case 'POST': - $route->setPattern($create_path); + $route->setPath($create_path); // Restrict the incoming HTTP Content-type header to the known // serialization formats. $route->addRequirements(array('_content_type_format' => implode('|', $this->serializerFormats))); @@ -206,7 +206,7 @@ protected function getBaseRoute($canonical_path, $method) { '_permission' => "restful $lower_method $this->pluginId", ), array(), - array(), + '', array(), // The HTTP method is a requirement for this route. array($method) diff --git a/core/modules/rest/src/Routing/ResourceRoutes.php b/core/modules/rest/src/Routing/ResourceRoutes.php index 484c48e..a561b8b 100644 --- a/core/modules/rest/src/Routing/ResourceRoutes.php +++ b/core/modules/rest/src/Routing/ResourceRoutes.php @@ -74,7 +74,8 @@ protected function alterRoutes(RouteCollection $collection) { $plugin = $this->manager->getInstance(array('id' => $id)); foreach ($plugin->routes() as $name => $route) { - $method = $route->getRequirement('_method'); + // @todo: Are multiple methods possible here? + $method = $route->getMethods()[0]; // Only expose routes where the method is enabled in the configuration. if ($method && isset($enabled_methods[$method])) { $route->setRequirement('_access_rest_csrf', 'TRUE');