Made key and name attributes optional in register-group-instance TDF elements

Also removed the attribute from all instances of the element, where it wasn't necessary.
This commit is contained in:
Nav
2024-08-13 19:54:05 +01:00
parent 7cf5afde2d
commit f1c82ecd28
265 changed files with 8717 additions and 8742 deletions

View File

@@ -162,8 +162,14 @@ class ToXmlService
DOMDocument $document
): DOMElement {
$element = $document->createElement('register-group-instance');
$element->setAttribute('key', $registerGroupInstance->key);
$element->setAttribute('name', $registerGroupInstance->name);
if (!empty($registerGroupInstance->key)) {
$element->setAttribute('key', $registerGroupInstance->key);
}
if (!empty($registerGroupInstance->name)) {
$element->setAttribute('name', $registerGroupInstance->name);
}
if (!empty($registerGroupInstance->description)) {
$element->setAttribute('description', $registerGroupInstance->description);