Issue #3266544 by Spokje, xjm, smustgrave, bbrala, catch: Remove remaining (textual) references to the HAL module
parent
f88d58b0b2
commit
837957e1f0
|
@ -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.
|
||||
|
|
|
@ -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>';
|
||||
|
|
|
@ -64,7 +64,7 @@ use Psr\Http\Message\ResponseInterface;
|
|||
*
|
||||
* 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 @@ abstract class EntityResourceTestBase extends ResourceTestBase {
|
|||
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();
|
||||
|
|
|
@ -82,7 +82,7 @@ class ResourceTest extends BrowserTestBase {
|
|||
// 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 @@ class ResourceTest extends BrowserTestBase {
|
|||
// 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);
|
||||
}
|
||||
|
||||
|
|
|
@ -59,7 +59,6 @@ class EntityReferenceFieldItemNormalizer extends FieldItemNormalizer {
|
|||
$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);
|
||||
}
|
||||
|
|
|
@ -36,7 +36,7 @@ class RenderArrayNonHtmlSubscriberTest extends BrowserTestBase {
|
|||
$this->assertSession()->pageTextContains("Controller response successfully rendered.");
|
||||
|
||||
// Test that correct response code is returned for any non-HTML format.
|
||||
foreach (['json', 'hal+json', 'xml', 'foo'] as $format) {
|
||||
foreach (['json', 'xml', 'foo'] as $format) {
|
||||
$url = Url::fromRoute('render_array_non_html_subscriber_test.render_array', [
|
||||
'_format' => $format,
|
||||
]);
|
||||
|
|
Loading…
Reference in New Issue