File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed
Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -391,10 +391,22 @@ public function getPresentations(): array
391391 public function getModules (): string
392392 {
393393 $ xml = new SimpleXMLElementExtended ('<?xml version="1.0" encoding="UTF-8"?><modules/> ' );
394+ // Get empty xml as string
395+ $ emptyXML = $ xml ->asXML ();
396+
397+ // Add modules
394398 $ this ->addPresentationsModule ($ xml );
395399 $ this ->addClientSettingsOverrideModule ($ xml );
396400
397- return $ xml ->asXML ();
401+ // Get xml as string after modules have been added
402+ $ resultXML = $ xml ->asXML ();
403+
404+ // If xml was not modified (no modules added), return an empty string
405+ if ($ emptyXML === $ resultXML ) {
406+ return '' ;
407+ }
408+
409+ return $ resultXML ;
398410 }
399411
400412 public function addClientSettingsOverrideModule (SimpleXMLElementExtended $ xml ): void
You can’t perform that action at this time.
0 commit comments