We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6d3b9af commit db59ce7Copy full SHA for db59ce7
src/nodes/MediaEmbed.php
@@ -2,6 +2,10 @@
2
namespace verbb\vizy\nodes;
3
4
use verbb\vizy\base\Node;
5
+use verbb\vizy\helpers\StringHelper;
6
+
7
+use craft\base\ElementInterface;
8
+use craft\helpers\Json;
9
10
class MediaEmbed extends Node
11
{
@@ -18,4 +22,14 @@ public function renderNode(array $config = []): ?string
18
22
19
23
return $this->attrs['data']['html'] ?? null;
20
24
}
25
26
+ public function serializeValue(ElementInterface $element = null): ?array
27
+ {
28
+ $value = parent::serializeValue($element);
29
30
+ // In case the payload contains emoji's, the field will throw an error
31
+ $value = Json::decode(StringHelper::emojiToShortcodes(Json::encode($value)));
32
33
+ return $value;
34
+ }
21
35
0 commit comments