Commit fe621868 authored by catch's avatar catch

Issue #2893804 by Wim Leers, Stefdewa, Berdir, catch: fix deprecation notices in REST bc layers

(cherry picked from commit 9664d378)
parent a31620b8
......@@ -32,7 +32,7 @@ function hook_rest_resource_alter(&$definitions) {
* Alter the REST type URI.
*
* @deprecated in drupal:8.3.0 and is removed from drupal:9.0.0. Use
* hook_serialization_type_uri_alter() instead. This exists solely for BC.
* hook_hal_type_uri_alter() instead. This exists solely for BC.
*
* @see https://www.drupal.org/node/2830467
*
......@@ -51,7 +51,7 @@ function hook_rest_resource_alter(&$definitions) {
*/
function hook_rest_type_uri_alter(&$uri, $context = []) {
if ($context['mymodule'] == TRUE) {
$base = \Drupal::config('serialization.settings')->get('link_domain');
$base = \Drupal::config('hal.settings')->get('link_domain');
$uri = str_replace($base, 'http://mymodule.domain', $uri);
}
}
......@@ -60,7 +60,7 @@ function hook_rest_type_uri_alter(&$uri, $context = []) {
* Alter the REST relation URI.
*
* @deprecated in drupal:8.3.0 and is removed from drupal:9.0.0. Use
* hook_serialization_relation_uri_alter() instead. This exists solely for BC.
* hook_hal_relation_uri_alter() instead. This exists solely for BC.
*
* @see https://www.drupal.org/node/2830467
*
......@@ -79,7 +79,7 @@ function hook_rest_type_uri_alter(&$uri, $context = []) {
*/
function hook_rest_relation_uri_alter(&$uri, $context = []) {
if ($context['mymodule'] == TRUE) {
$base = \Drupal::config('serialization.settings')->get('link_domain');
$base = \Drupal::config('hal.settings')->get('link_domain');
$uri = str_replace($base, 'http://mymodule.domain', $uri);
}
}
......
......@@ -108,6 +108,7 @@ public function routes() {
// then changed to reading the 'create' URI path. For any REST Resource
// plugins that were using the old mechanism, we continue to support that.
if (!isset($definition['uri_paths']['create']) && isset($definition['uri_paths']['https://www.drupal.org/link-relations/create'])) {
@trigger_error('The "https://www.drupal.org/link-relations/create" string as a RestResource plugin annotation URI path key is deprecated in Drupal 8.4.0, now a valid link relation type name must be specified, so "create" must be specified instead before Drupal 9.0.0. See https://www.drupal.org/node/2737401.', E_USER_DEPRECATED);
$create_path = $definition['uri_paths']['https://www.drupal.org/link-relations/create'];
}
......
......@@ -146,6 +146,7 @@ public static function getSkippedDeprecations() {
'The "core/classList" asset library is deprecated in drupal:8.8.0 and is removed from drupal:9.0.0. Use the the native browser implementation instead. See https://www.drupal.org/node/3089511',
'The "core/jquery.ui.datepicker" asset library is deprecated in drupal:8.8.0 and is removed from drupal:9.0.0. See https://www.drupal.org/node/3081864',
'The "locale/drupal.locale.datepicker" asset library is deprecated in drupal:8.8.0 and is removed from drupal:9.0.0. See https://www.drupal.org/node/3081864',
'The "https://www.drupal.org/link-relations/create" string as a RestResource plugin annotation URI path key is deprecated in Drupal 8.4.0, now a valid link relation type name must be specified, so "create" must be specified instead before Drupal 9.0.0. See https://www.drupal.org/node/2737401.',
];
}
......
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