Commit 5b43b3dc authored by catch's avatar catch

Issue #2934994 by Wim Leers, Mile23: Complete deprecation of...

Issue #2934994 by Wim Leers, Mile23: Complete deprecation of hook_rest_type_uri_alter(), hook_rest_relation_uri_alter()
parent 80ee826c
......@@ -70,10 +70,7 @@ public function getRelationUri($entity_type, $bundle, $field_name, $context = []
// override the RelationLinkManager class/service to return the desired URL.
$uri = $this->getLinkDomain($context) . "/rest/relation/$entity_type/$bundle/$field_name";
$this->moduleHandler->alter('hal_relation_uri', $uri, $context);
// @deprecated in Drupal 8.3.x and will be removed before Drupal 9.0.0. This
// hook is invoked to maintain backwards compatibility
// @see https://www.drupal.org/node/2830467
$this->moduleHandler->alter('rest_relation_uri', $uri, $context);
$this->moduleHandler->alterDeprecated('This hook is deprecated in Drupal 8.3.x and will be removed before Drupal 9.0.0. Implement hook_hal_relation_uri_alter() instead.', 'rest_relation_uri', $uri, $context);
return $uri;
}
......
......@@ -71,10 +71,7 @@ public function getTypeUri($entity_type, $bundle, $context = []) {
// TypeLinkManager class/service to return the desired URL.
$uri = $this->getLinkDomain($context) . "/rest/type/$entity_type/$bundle";
$this->moduleHandler->alter('hal_type_uri', $uri, $context);
// @deprecated in Drupal 8.3.x and will be removed before Drupal 9.0.0. This
// hook is invoked to maintain backwards compatibility
// @see https://www.drupal.org/node/2830467
$this->moduleHandler->alter('rest_type_uri', $uri, $context);
$this->moduleHandler->alterDeprecated('This hook is deprecated in Drupal 8.3.x and will be removed before Drupal 9.0.0. Implement hook_hal_type_uri_alter() instead.', 'rest_type_uri', $uri, $context);
return $uri;
}
......
......@@ -13,6 +13,7 @@
/**
* @coversDefaultClass \Drupal\hal\LinkManager\LinkManager
* @group hal
* @group legacy
*/
class HalLinkManagerTest extends KernelTestBase {
......@@ -49,6 +50,7 @@ protected function setUp() {
/**
* @covers ::getTypeUri
* @dataProvider providerTestGetTypeUri
* @expectedDeprecation The deprecated alter hook hook_rest_type_uri_alter() is implemented in these functions: hal_test_rest_type_uri_alter. This hook is deprecated in Drupal 8.3.x and will be removed before Drupal 9.0.0. Implement hook_hal_type_uri_alter() instead.
*/
public function testGetTypeUri($link_domain, $entity_type, $bundle, array $context, $expected_return, array $expected_context) {
$hal_settings = \Drupal::configFactory()->getEditable('hal.settings');
......@@ -142,6 +144,7 @@ public function providerTestGetTypeUri() {
/**
* @covers ::getRelationUri
* @dataProvider providerTestGetRelationUri
* @expectedDeprecation The deprecated alter hook hook_rest_relation_uri_alter() is implemented in these functions: hal_test_rest_relation_uri_alter. This hook is deprecated in Drupal 8.3.x and will be removed before Drupal 9.0.0. Implement hook_hal_relation_uri_alter() instead.
*/
public function testGetRelationUri($link_domain, $entity_type, $bundle, $field_name, array $context, $expected_return, array $expected_context) {
$hal_settings = \Drupal::configFactory()->getEditable('hal.settings');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment