Fatal error when disabling a model that hasn't been saved yet
>>> [!note] Migrated issue
<!-- Drupal.org comment -->
<!-- Migrated from issue #3533720. -->
Reported by: [pameeela](https://www.drupal.org/user/1431110)
Related to !536
>>>
<h3 id="summary-problem-motivation">Problem/Motivation</h3>
<p>If you try to disable a module that has yet to be accessed/saved, for example one created by a recipe, you get a fatal error. The workaround is to edit the model first, then you see the success message that it has been saved, and then you can disable it.</p>
<h4 id="summary-steps-reproduce">Steps to reproduce</h4>
<ol>
<li>Install Drupal CMS</li>
<li>Go to the ECA page</li>
<li>Try to disable a model, see fatal error<br>
<pre>ValueError: DOMDocument::loadXML(): Argument #1 ($source) must not be empty in DOMDocument->loadXML() (line 32 of /Users/pamelabarone/Documents/drupal/vendor/mtownsend/xml-to-array/src/XmlToArray.php).</pre></li>
<li>Edit the model, see message that it was saved</li>
<li>Try to disable again, see that it works</li>
</ol>
<h3 id="summary-proposed-resolution">Proposed resolution</h3>
<p>Not sure -- this isn't necessarily a critical issue, but ideally the exception can be handled better.</p>
<p>Full stacktrace:</p>
<pre>Mtownsend\XmlToArray\XmlToArray::xmlStringToArray('') (Line: 22)<br>Mtownsend\XmlToArray\XmlToArray::convert('') (Line: 88)<br>Drupal\eca_modeller_bpmn\ModellerBpmnBase->prepareForUpdate('') (Line: 283)<br>Drupal\eca_modeller_bpmn\ModellerBpmnBase->disable() (Line: 151)<br>Drupal\eca_ui\Controller\EcaController->disable('front_page_redirect_hotfix')<br>call_user_func_array(Array, Array) (Line: 123)<br>Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 622)<br>Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 121)<br>Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)<br>Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 183)<br>Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 76)<br>Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 53)<br>Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)<br>Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 28)<br>Drupal\Core\StackMiddleware\ContentLength->handle(Object, 1, 1) (Line: 32)<br>Drupal\big_pipe\StackMiddleware\ContentLength->handle(Object, 1, 1) (Line: 116)<br>Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 90)<br>Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 48)<br>Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)<br>Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 53)<br>Drupal\Core\StackMiddleware\AjaxPageState->handle(Object, 1, 1) (Line: 51)<br>Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object, 1, 1) (Line: 715)<br>Drupal\Core\DrupalKernel->handle(Object) (Line: 19)<br>require('/Users/pamelabarone/Documents/drupal/web/index.php') (Line: 71)</pre>
issue