layoutFormat - Flip default from shallow to deep
authorTim Otten <totten@civicrm.org>
Wed, 11 Sep 2019 22:39:09 +0000 (18:39 -0400)
committerCiviCRM <info@civicrm.org>
Wed, 16 Sep 2020 02:13:18 +0000 (19:13 -0700)
ext/afform/core/Civi/Api4/Utils/AfformFormatTrait.php

index dd3e7cd6e329109bad3ab4007b8bd8a00b1cb978..072528608bd721ccc344be093b6f9a9242e3cce7 100644 (file)
@@ -14,7 +14,7 @@ trait AfformFormatTrait {
    * @var string
    * @options html,shallow,deep
    */
-  protected $layoutFormat = 'shallow';
+  protected $layoutFormat = 'deep';
 
   /**
    * @param string $html
@@ -25,7 +25,7 @@ trait AfformFormatTrait {
     if ($this->layoutFormat === 'html') {
       return $html;
     }
-    $converter = new \CRM_Afform_ArrayHtml($this->layoutFormat === 'deep');
+    $converter = new \CRM_Afform_ArrayHtml($this->layoutFormat !== 'shallow');
     return $converter->convertHtmlToArray($html);
   }
 
@@ -38,7 +38,7 @@ trait AfformFormatTrait {
     if ($this->layoutFormat === 'html') {
       return $mixed;
     }
-    $converter = new \CRM_Afform_ArrayHtml($this->layoutFormat === 'deep');
+    $converter = new \CRM_Afform_ArrayHtml($this->layoutFormat !== 'shallow');
     return $converter->convertArrayToHtml($mixed);
   }