Skip to content
Snippets Groups Projects

Issue #3336147: URL for link enhancer uses arbitrary language type (interface)

Merged Issue #3336147: URL for link enhancer uses arbitrary language type (interface)
Merged Marc Orcau requested to merge issue/jsonapi_extras-3336147:8.x-3.x into 8.x-3.x
@@ -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();
Loading