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
1 file
+ 2
1
Compare changes
  • Side-by-side
  • Inline
@@ -2,6 +2,7 @@
@@ -2,6 +2,7 @@
namespace Drupal\jsonapi_extras\Plugin\jsonapi\FieldEnhancer;
namespace Drupal\jsonapi_extras\Plugin\jsonapi\FieldEnhancer;
 
use Drupal\Core\Language\LanguageInterface;
use Drupal\Core\Language\LanguageManagerInterface;
use Drupal\Core\Language\LanguageManagerInterface;
use Drupal\Core\Logger\LoggerChannelFactoryInterface;
use Drupal\Core\Logger\LoggerChannelFactoryInterface;
use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
@@ -106,7 +107,7 @@ class UrlLinkEnhancer extends ResourceFieldEnhancerBase implements ContainerFact
@@ -106,7 +107,7 @@ class UrlLinkEnhancer extends ResourceFieldEnhancerBase implements ContainerFact
protected function doUndoTransform($data, Context $context) {
protected function doUndoTransform($data, Context $context) {
if (isset($data['uri'])) {
if (isset($data['uri'])) {
try {
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.
// Use absolute urls if configured.
$configuration = $this->getConfiguration();
$configuration = $this->getConfiguration();
Loading