Created
October 28, 2019 00:32
-
-
Save fmfpereira/70d1959a4788884c32ba0b3d6ddeda4d to your computer and use it in GitHub Desktop.
Fix issue with destination as an array for layout builder.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/linked_field.module b/linked_field.module | |
index 1bbcb82..4d513ad 100644 | |
--- a/linked_field.module | |
+++ b/linked_field.module | |
@@ -349,6 +349,11 @@ function linked_field_entity_display_build_alter(&$build, $context) { | |
// Normalize the settings. | |
$destination = isset($settings['destination']) ? $settings['destination'] : FALSE; | |
+ // Fix issue with destination as an array for layout builder. | |
+ if (is_array($destination)) { | |
+ $destination = array_filter($destination); | |
+ $destination = reset($destination); | |
+ } | |
$linked = isset($settings['linked']) ? $settings['linked'] : FALSE; | |
$destination_type = isset($settings['type']) ? $settings['type'] : 'custom'; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment