Fix warnings for `#text` format
authorTim Otten <totten@civicrm.org>
Fri, 1 Nov 2019 04:53:44 +0000 (21:53 -0700)
committerCiviCRM <info@civicrm.org>
Wed, 16 Sep 2020 02:13:19 +0000 (19:13 -0700)
ext/afform/core/Civi/Afform/AHQ.php
ext/afform/core/Civi/Afform/FormDataModel.php

index 711ad668e3cd8da0f9c611ee1bac218aaaff3a50..1a8f1edb610edbf2b28e81856a4b7e9fac788124 100644 (file)
@@ -19,7 +19,7 @@ class AHQ {
    * @return array
    */
   public static function getTags($element, $tagName) {
-    if ($element === [] || is_string($element)) {
+    if ($element === [] || is_string($element) || isset($element['#text'])) {
       return [];
     }
     $results = [];
index 5055e14cf82a422b580e1529cb0016a3603a334c..ec8cb7fdb22588fe816bdcda9dcf0c5deeb7f30d 100644 (file)
@@ -54,7 +54,7 @@ class FormDataModel {
       return;
     }
     foreach ($element['#children'] as $child) {
-      if (is_string($child)) {
+      if (is_string($child) || isset($child['#text'])) {
         //nothing
       }
       elseif (!empty($child['af-fieldset']) && !empty($child['#children'])) {