Skip to content
Snippets Groups Projects
Commit 5d8641d4 authored by Marc Orcau's avatar Marc Orcau Committed by Björn Brala
Browse files

Issue #3336147 by budalokko, bbrala, Paul_Gregory: URL for link enhancer uses...

Issue #3336147 by budalokko, bbrala, Paul_Gregory: URL for link enhancer uses arbitrary language type (interface)
parent 373f0114
No related branches found
No related tags found
1 merge request!25Issue #3336147: URL for link enhancer uses arbitrary language type (interface)
Pipeline #181370 passed with warnings
......@@ -2,6 +2,7 @@
namespace Drupal\jsonapi_extras\Plugin\jsonapi\FieldEnhancer;
use Drupal\Core\Language\LanguageInterface;
use Drupal\Core\Language\LanguageManagerInterface;
use Drupal\Core\Logger\LoggerChannelFactoryInterface;
use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
......@@ -106,7 +107,7 @@ class UrlLinkEnhancer extends ResourceFieldEnhancerBase implements ContainerFact
protected function doUndoTransform($data, Context $context) {
if (isset($data['uri'])) {
try {
$url = Url::fromUri($data['uri'], ['language' => $this->languageManager->getCurrentLanguage()]);
$url = Url::fromUri($data['uri'], ['language' => $this->languageManager->getCurrentLanguage(LanguageInterface::TYPE_CONTENT)]);
// Use absolute urls if configured.
$configuration = $this->getConfiguration();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment