Verified Commit 837957e1 authored by quietone's avatar quietone
Browse files

Issue #3266544 by Spokje, xjm, smustgrave, bbrala, catch: Remove remaining...

Issue #3266544 by Spokje, xjm, smustgrave, bbrala, catch: Remove remaining (textual) references to the HAL module
parent f88d58b0
Loading
Loading
Loading
Loading
+1 −1
Changes for core/core.api.php: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -128,7 +128,7 @@
 *   - The request method must be set to the REST method you are using (POST,
 *     GET, PATCH, etc.).
 *   - The content type for the data you send, or the accept type for the
 *     data you are receiving, must be set to 'application/hal+json'.
 *     data you are receiving, must be set to 'application/json'.
 *   - If you are sending data, it must be JSON-encoded.
 *   - You'll also need to make sure the authentication information is sent
 *     with the request, unless you have allowed access to anonymous users.
+1 −1
Changes for core/modules/rest/rest.module: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -20,7 +20,7 @@ function rest_help($route_name, RouteMatchInterface $route_match) {
      $output .= '<h3>' . t('Uses') . '</h3>';
      $output .= '<dl>';
      $output .= '<dt>' . t('Installing supporting modules') . '</dt>';
      $output .= '<dd>' . t('In order to use REST on a website, you need to install modules that provide serialization and authentication services. You can use the Core module <a href=":hal">HAL</a> for serialization and <a href=":basic_auth">HTTP Basic Authentication</a> for authentication, or install a contributed or custom module.', [':hal' => (\Drupal::moduleHandler()->moduleExists('hal')) ? Url::fromRoute('help.page', ['name' => 'hal'])->toString() : 'https://www.drupal.org/docs/8/core/modules/hal/overview', ':basic_auth' => (\Drupal::moduleHandler()->moduleExists('basic_auth')) ? Url::fromRoute('help.page', ['name' => 'basic_auth'])->toString() : 'https://www.drupal.org/docs/8/core/modules/basic_auth/overview']) . '</dd>';
      $output .= '<dd>' . t('In order to use REST on a website, you need to install modules that provide serialization and authentication services. You can use the Core module <a href=":serialization">serialization</a> for serialization and <a href=":basic_auth">HTTP Basic Authentication</a> for authentication, or install a contributed or custom module.', [':serialization' => (\Drupal::moduleHandler()->moduleExists('serialization')) ? Url::fromRoute('help.page', ['name' => 'serialization'])->toString() : 'https://www.drupal.org/docs/8/core/modules/serialization/overview', ':basic_auth' => (\Drupal::moduleHandler()->moduleExists('basic_auth')) ? Url::fromRoute('help.page', ['name' => 'basic_auth'])->toString() : 'https://www.drupal.org/docs/8/core/modules/basic_auth/overview']) . '</dd>';
      $output .= '<dt>' . t('Enabling REST support for an entity type') . '</dt>';
      $output .= '<dd>' . t('REST support for content types (provided by the <a href=":node">Node</a> module) is enabled by default. To enable support for other content entity types, you can use a <a href=":config" target="blank">process based on configuration editing</a> or the contributed <a href=":restui">REST UI module</a>.', [':node' => (\Drupal::moduleHandler()->moduleExists('node')) ? Url::fromRoute('help.page', ['name' => 'node'])->toString() : '#', ':config' => 'https://www.drupal.org/documentation/modules/rest', ':restui' => 'https://www.drupal.org/project/restui']) . '</dd>';
      $output .= '<dd>' . t('You will also need to grant anonymous users permission to perform each of the REST operations you want to be available, and set up authentication properly to authorize web requests.') . '</dd>';
+2 −2
Changes for core/modules/rest/tests/src/Functional/EntityResource/EntityResourceTestBase.php: 2 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -64,7 +64,7 @@
 *
 * If there is an entity type-specific format-specific edge case to test, then
 * add that to a concrete subclass. Example:
 * \Drupal\Tests\hal\Functional\EntityResource\Comment\CommentHalJsonTestBase::$patchProtectedFieldNames
 * \Drupal\Tests\comment\Functional\Rest\CommentJsonAnonTest::$patchProtectedFieldNames
 */
abstract class EntityResourceTestBase extends ResourceTestBase {

@@ -1386,7 +1386,7 @@ protected function assertResourceNotAvailable(Url $url, array $request_options)
  protected function assertStoredEntityMatchesSentNormalization(array $sent_normalization, FieldableEntityInterface $modified_entity) {
    foreach ($sent_normalization as $field_name => $field_normalization) {
      // Some top-level keys in the normalization may not be fields on the
      // entity (for example '_links' and '_embedded' in the HAL normalization).
      // entity.
      if ($modified_entity->hasField($field_name)) {
        $field_definition = $modified_entity->get($field_name)->getFieldDefinition();
        $property_definitions = $field_definition->getItemDefinition()->getPropertyDefinitions();
+2 −2
Changes for core/modules/rest/tests/src/Functional/ResourceTest.php: 2 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -82,7 +82,7 @@ public function testFormats() {
    // non-REST route a match, but a lower quality one: no format restrictions
    // means there's always a match and hence when there is no matching REST
    // route, the non-REST route is used, but can't render into
    // application/hal+json, so it returns a 406.
    // application/json, so it returns a 406.
    $this->assertSession()->statusCodeEquals(406);
  }

@@ -108,7 +108,7 @@ public function testAuthentication() {
    // non-REST route a match, but a lower quality one: no format restrictions
    // means there's always a match and hence when there is no matching REST
    // route, the non-REST route is used, but can't render into
    // application/hal+json, so it returns a 406.
    // application/json, so it returns a 406.
    $this->assertSession()->statusCodeEquals(406);
  }

+0 −1
Changes for core/modules/serialization/src/Normalizer/EntityReferenceFieldItemNormalizer.php: 0 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -59,7 +59,6 @@ public function normalize($field_item, $format = NULL, array $context = []): arr
        $values['url'] = $url->getGeneratedUrl();
      }
      // @todo Remove in https://www.drupal.org/project/drupal/issues/2925520
      // @see \Drupal\hal\Normalizer\FileEntityNormalizer
      elseif ($entity instanceof FileInterface) {
        $values['url'] = $entity->createFileUrl(FALSE);
      }
Loading