Created
November 17, 2015 08:56
-
-
Save mccrodp/8b3f933c5fd97ab8359f to your computer and use it in GitHub Desktop.
Message text : Process markup - Pass 1
This file contains hidden or 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/src/Entity/Message.php b/src/Entity/Message.php | |
index e000146..e9b322f 100644 | |
--- a/src/Entity/Message.php | |
+++ b/src/Entity/Message.php | |
@@ -317,9 +317,9 @@ class Message extends ContentEntityBase implements MessageInterface { | |
$output = strtr($output, $args); | |
} | |
- $output = \Drupal::token()->replace($output, array('message' => $this), $options); | |
+ $element['#markup'] = \Drupal::token()->replace($output, array('message' => $this), $options); | |
- return $output; | |
+ return \Drupal::service('renderer')->render($element); | |
} | |
/** | |
diff --git a/src/Entity/MessageType.php b/src/Entity/MessageType.php | |
index 94f78fa..73c0330 100644 | |
--- a/src/Entity/MessageType.php | |
+++ b/src/Entity/MessageType.php | |
@@ -344,7 +344,9 @@ class MessageType extends ConfigEntityBase implements ConfigEntityInterface { | |
} | |
// Combine all the field text and return it as a trimmed text. | |
- return trim(implode("\n", $text)); | |
+ $element['#markup'] = trim(implode("\n", $text)); | |
+ | |
+ return \Drupal::service('renderer')->render($element); | |
} | |
/** |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment