@@ -167,7 +167,7 @@ public function authorUser()
167167 'author ' , 'id '
168168 )->select (
169169 'id ' , 'uuid ' , 'first_name ' , 'last_name ' , 'email ' ,
170- 'username ' , 'display_name ' , 'title ' , 'bio ' , 'website ' ,
170+ 'username ' , 'display_name ' , 'title ' , 'bio ' , 'website '
171171 );
172172 }
173173 //-------------------------------------------------
@@ -438,11 +438,18 @@ public static function getFormGroups(Content $content, $type, array $fields=null
438438 $ field_content ->where ('vh_cms_form_field_id ' , $ field ->id );
439439 $ field_content = $ field_content ->first ();
440440
441-
442441 if ($ field_content )
443442 {
444443 $ groups [$ i ]['fields ' ][$ y ]['vh_cms_form_field_id ' ] = $ field_content ->id ;
445- $ groups [$ i ]['fields ' ][$ y ]['content ' ] = $ field_content ->content ;
444+
445+ if (is_array ($ field_content ->content ) || is_object ($ field_content ->content )){
446+ $ groups [$ i ]['fields ' ][$ y ]['content ' ] = json_decode (
447+ vh_translate_dynamic_strings (json_encode ($ field_content ->content ))
448+ );
449+ }else {
450+ $ groups [$ i ]['fields ' ][$ y ]['content ' ] = vh_translate_dynamic_strings ($ field_content ->content );
451+ }
452+
446453 $ groups [$ i ]['fields ' ][$ y ]['content_meta ' ] = $ field_content ->meta ;
447454 }
448455
@@ -533,9 +540,18 @@ public static function storeFormGroups(Content $content, $groups)
533540 $ stored_field ->vh_cms_form_field_id = $ field ['id ' ];
534541 }
535542
536- if (is_array ($ field ['content ' ]) || is_object ($ field ['content ' ]))
537- {
538- $ field ['content ' ] = json_encode ($ field ['content ' ]);
543+ if (is_array ($ field ['content ' ]) || is_object ($ field ['content ' ])){
544+ $ field ['content ' ] = json_decode (
545+ vh_translate_dynamic_strings (
546+ json_encode ($ field ['content ' ]),
547+ ['has_replace_string ' => true ]
548+ )
549+ );
550+ }else {
551+ $ field ['content ' ] = vh_translate_dynamic_strings (
552+ $ field ['content ' ],
553+ ['has_replace_string ' => true ]
554+ );
539555 }
540556
541557 if ($ field ['type ' ]['slug ' ] == 'user ' && $ field ['content ' ]){
0 commit comments