ArrayHtml - Treat `<af-entity/>` and `<af-field/>` as self-closing tags
authorTim Otten <totten@civicrm.org>
Tue, 29 Oct 2019 23:11:10 +0000 (16:11 -0700)
committerCiviCRM <info@civicrm.org>
Wed, 16 Sep 2020 02:13:19 +0000 (19:13 -0700)
ext/afform/core/CRM/Afform/ArrayHtml.php
ext/afform/mock/tests/phpunit/api/v4/formatExamples/banana.php

index 748dadfec3408a5e82ca0fd3af38f4742e2f7833..6f511792625903477cbac105b23505868f7c4913 100644 (file)
@@ -22,11 +22,13 @@ class CRM_Afform_ArrayHtml {
       '*' => 'text',
     ],
     'af-entity' => [
+      '#selfClose' => TRUE,
       'name' => 'text',
       'type' => 'text',
       'data' => 'js',
     ],
     'af-field' => [
+      '#selfClose' => TRUE,
       'name' => 'text',
       'defn' => 'js',
     ],
index 779b3cd4469cf9528120b4dd44adf5cde0092e70..bf33a0a21f0c4e75c4ad354d5d8449376f763194 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 
 return [
-  'html' => '<div><strong>New text!</strong><af-field name="do_not_sms" defn="{label: \'Do not do any of the emailing\'}"></af-field></div>',
+  'html' => '<div><strong>New text!</strong><af-field name="do_not_sms" defn="{label: \'Do not do any of the emailing\'}" /></div>',
   'shallow' => [
     [
       '#tag' => 'div',