Skip to content
Snippets Groups Projects
Commit 7203eba4 authored by Alexandre Israël's avatar Alexandre Israël
Browse files

git commit -m 'Issue #3437655 by allan.ordogh: Add langcode paramater'

parent 49551d93
Branches 2.0.x
1 merge request!6git commit -m 'Issue #3437655 by allan.ordogh: Add langcode paramater'
......@@ -147,7 +147,7 @@ class PathAndFormatSetter implements HttpKernelInterface {
// Lookup bundle & uuid for node id in our custom key-value store.
if ($info = $this->store->get($path)) {
// Build the default JSON-API path.
$path = $this->buildJsonApiPath($info);
$path = $this->buildJsonApiPath($info, $langcode);
// Replace immutable request with modified clone.
if(!empty($langcode)) {
......@@ -242,11 +242,11 @@ class PathAndFormatSetter implements HttpKernelInterface {
* @return string
* The
*/
protected function buildJsonApiPath($info) {
protected function buildJsonApiPath($info, $langcode) {
if (isset($info['bundle']) && $info['bundle'] !== null) {
return '/' . $this->jsonapiPrefix . '/' . $info['type'] . '/' . $info['bundle'] . '/' . $info['uuid'];
return '/' . $langcode . '/' . $this->jsonapiPrefix . '/' . $info['type'] . '/' . $info['bundle'] . '/' . $info['uuid'];
} else {
return '/' . $this->jsonapiPrefix . '/' . $info['type'] . '/' . $info['uuid'];
return '/' . $langcode . '/' . $this->jsonapiPrefix . '/' . $info['type'] . '/' . $info['uuid'];
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment