</code><h3 id="summary-problem-motivation">Problem/Motivation</h3>
i wanted to export a bpmn model that contains every event, action, and condition for https://www.drupal.org/project/eca/issues/3305587#comment-14666991 . but i ran into the following error on export: 

<code>The website encountered an unexpected error. Please try again later.
TypeError: Drupal\eca\Service\Modellers::getNestedDependencies(): Argument #2 ($dependencies) must be of type array, null given, called in /var/www/html/web/modules/contrib/eca/src/Service/Modellers.php on line 338 in Drupal\eca\Service\Modellers->getNestedDependencies() (line 325 of modules/contrib/eca/src/Service/Modellers.php).
Drupal\eca\Service\Modellers->getNestedDependencies(Array, NULL) (Line: 338)
Drupal\eca\Service\Modellers->getNestedDependencies(Array, Array) (Line: 288)
Drupal\eca\Service\Modellers->exportArchive(Object, 'temporary://bpmn_io-process_z6jzc9k.tar.gz') (Line: 300)
Drupal\eca_modeller_bpmn\ModellerBpmnBase->export() (Line: 186)
Drupal\eca_ui\Controller\EcaController->export('process_z6jzc9k')
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 564)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 158)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 80)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 58)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 50)
Drupal\ban\BanMiddleware->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 709)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

the export of smaller models worked without any error. might be the case that not all fields are filled. the main purpose of that model was to see the micro copy of the model elements in context.

Issue fork eca-3305971

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

rkoller created an issue. See original summary.

jurgenhaas made their first commit to this issue’s fork.

jurgenhaas’s picture

Status: Active » Needs review

Please give MR !128 a try

rkoller’s picture

Issue summary: View changes
Status: Needs review » Needs work

the export seems to work now. but when i've reloaded the model listing page before the export i got the following new error:

Warning: Trying to access array offset on value of type bool in Drupal\eca\Service\Modellers->getNestedDependencies() (line 337 of modules/contrib/eca/src/Service/Modellers.php).
Drupal\eca\Service\Modellers->getNestedDependencies(Array, Array) (Line: 288)
Drupal\eca\Service\Modellers->exportArchive(Object, 'temporary://bpmn_io-process_z6jzc9k.tar.gz') (Line: 300)
Drupal\eca_modeller_bpmn\ModellerBpmnBase->export() (Line: 186)
Drupal\eca_ui\Controller\EcaController->export('process_z6jzc9k')
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 564)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 158)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 80)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 58)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 50)
Drupal\ban\BanMiddleware->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 709)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

and when i tried to reimport the exported model i ran into the following (is that related and needs a follow up or is it ok in the scope of this issue - just wanted to mention it that it happened when validating the changes):

The website encountered an unexpected error. Please try again later.
TypeError: Drupal\config\StorageReplaceDataWrapper::replaceData(): Argument #2 ($data) must be of type array, bool given, called in /var/www/html/web/modules/contrib/eca/modules/ui/src/Form/Import.php on line 325 in Drupal\config\StorageReplaceDataWrapper->replaceData() (line 198 of core/modules/config/src/StorageReplaceDataWrapper.php).
Drupal\config\StorageReplaceDataWrapper->replaceData('views.view.', ) (Line: 325)
Drupal\eca_ui\Form\Import->submitForm(Array, Object)
call_user_func_array(Array, Array) (Line: 114)
Drupal\Core\Form\FormSubmitter->executeSubmitHandlers(Array, Object) (Line: 52)
Drupal\Core\Form\FormSubmitter->doSubmitForm(Array, Object) (Line: 592)
Drupal\Core\Form\FormBuilder->processForm('eca_import', Array, Object) (Line: 320)
Drupal\Core\Form\FormBuilder->buildForm(Object, Object) (Line: 73)
Drupal\Core\Controller\FormController->getContentResult(Object, Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 564)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 158)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 80)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 58)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 50)
Drupal\ban\BanMiddleware->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 709)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
rkoller’s picture

after the second error when going back to the models list page and reload the first error from #5 hasn't shown up again. but when i went to the model import page the same first error from #5 showed up now.

jurgenhaas’s picture

Status: Needs work » Needs review

The first one from #5 is just a warning and a follow-up on the original exception caused by my lazy approach of solving the problem.

The other one, when importing the model, is unrelated. I suggest we keep this issue to the export problem. Once that's completely solved, let's have a look at the import in a separate issue.

I have updated the MR, so the warning should no longer appear - and the exception should also be resolved. If the warning appears once more, that may well be from the previous page request. You may want to refresh the page once or twice before then trying the export again with the latest MR.

jurgenhaas’s picture

Issue tags: +backport
rkoller’s picture

Status: Needs review » Reviewed & tested by the community

i've applied the updated patch. the export works now as well as no more warning is showing up. looks good. thanks for the fast fix. and for the re import i will open up a new issue. lets RTBC this one here.

  • jurgenhaas committed 638f9f5 on 1.1.x
    Issue #3305971 by jurgenhaas, rkoller: Unexpected error on model export
    

  • jurgenhaas committed aa59561 on 1.0.x
    Issue #3305971 by jurgenhaas, rkoller: Unexpected error on model export
    
jurgenhaas’s picture

Status: Reviewed & tested by the community » Fixed

Merged and back-ported.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.