}
}
+ /**
+ * Get any smarty elements that may not be present in the form.
+ *
+ * To make life simpler for smarty we ensure they are set to null
+ * rather than unset. This is done at the last minute when $this
+ * is converted to an array to be assigned to the form.
+ *
+ * @return array
+ */
+ public function getOptionalQuickFormElements(): array {
+ return ['separation', 'tag'];
+ }
+
/**
* Set default values for the form.
*
/**
* Add an optional element to the optional elements array.
*
+ * These elements are assigned as empty (null) variables if
+ * there is no real field - allowing smarty to use them without
+ * notices.
+ *
* @param string $elementName
*/
public function addOptionalQuickFormElement(string $elementName): void {
</td>
</tr>
- {if !empty($form.separation)}
+ {if $form.separation}
<tr class="crm-activity-form-block-separation crm-is-multi-activity-wrapper">
<td class="label">{$form.separation.label}</td>
<td>{$form.separation.html} {help id="separation"}</td>
<td class="label">{$form.result.label}</td><td class="view-value">{$form.result.html}</td>
</tr>
{/if}
- {if !empty($form.tag.html)}
+ {if $form.tag}
<tr class="crm-activity-form-block-tag">
<td class="label">{$form.tag.label}</td>
<td class="view-value">