summaryrefslogtreecommitdiffstats
path: root/core/modules/rest/src/Plugin/rest/resource/EntityResource.php
diff options
context:
space:
mode:
authorwebchick2015-01-29 20:56:19 -0800
committerwebchick2015-01-29 20:56:19 -0800
commit0fb9bb5474f6ed6d09849b55091434c33c297db1 (patch)
treef3de8f9b512efb912eaf2d64e7ed00e104e29216 /core/modules/rest/src/Plugin/rest/resource/EntityResource.php
parent0e914b24f65c521689e1c9b5fec99a9e0ffe4069 (diff)
Issue #2364157 by mpdonadio, dawehner, martin107, Berdir, pcambra, naveenvalecha, tim.plunkett: Replace most existing _url calls with Url objects
Diffstat (limited to 'core/modules/rest/src/Plugin/rest/resource/EntityResource.php')
-rw-r--r--core/modules/rest/src/Plugin/rest/resource/EntityResource.php3
1 files changed, 1 insertions, 2 deletions
diff --git a/core/modules/rest/src/Plugin/rest/resource/EntityResource.php b/core/modules/rest/src/Plugin/rest/resource/EntityResource.php
index 0f2a785..ffb15e0 100644
--- a/core/modules/rest/src/Plugin/rest/resource/EntityResource.php
+++ b/core/modules/rest/src/Plugin/rest/resource/EntityResource.php
@@ -99,9 +99,8 @@ class EntityResource extends ResourceBase {
$entity->save();
$this->logger->notice('Created entity %type with ID %id.', array('%type' => $entity->getEntityTypeId(), '%id' => $entity->id()));
- $url = _url(strtr($this->pluginId, ':', '/') . '/' . $entity->id(), array('absolute' => TRUE));
// 201 Created responses have an empty body.
- return new ResourceResponse(NULL, 201, array('Location' => $url));
+ return new ResourceResponse(NULL, 201, array('Location' => $entity->url('canonical', ['absolute' => TRUE])));
}
catch (EntityStorageException $e) {
throw new HttpException(500, 'Internal Server Error', $e);