[Bug]: User seeing 'Permissions missing to save the configuration' when trying perform workflow action
Expected behavior
Click
and then no error:
Actual behavior
Users are reporting seeing this error message when they select a workflow action:
which is odd, because this is the line of code I think is erroring:
https://github.com/pimcore/data-hub/blob/f4b9b01685822613730a426436292a49cf6acc35/src/Configuration.php#L228
Steps to reproduce
Unclear
do you have a stack trace in the docs? why would a workflow transition try to save a Datahub configuration?!
This is the stacktrace: This happens for non admin users.
#0 /var/www/html/vendor/pimcore/data-hub/src/EventListener/DataChangeListener.php(152): Pimcore\Bundle\DataHubBundle\Configuration->save()
#1 /var/www/html/vendor/pimcore/data-hub/src/EventListener/DataChangeListener.php(56): Pimcore\Bundle\DataHubBundle\EventListener\DataChangeListener->checkConfiguration()
#2 /var/www/html/vendor/symfony/event-dispatcher/EventDispatcher.php(260): Pimcore\Bundle\DataHubBundle\EventListener\DataChangeListener->onObjectUpdate()
#3 /var/www/html/vendor/symfony/event-dispatcher/EventDispatcher.php(220): Symfony\Component\EventDispatcher\EventDispatcher::Symfony\Component\EventDispatcher\{closure}()
#4 /var/www/html/vendor/symfony/event-dispatcher/EventDispatcher.php(56): Symfony\Component\EventDispatcher\EventDispatcher->callListeners()
#5 /var/www/html/vendor/pimcore/pimcore/lib/Event/Traits/RecursionBlockingEventDispatchHelperTrait.php(38): Symfony\Component\EventDispatcher\EventDispatcher->dispatch()
#6 /var/www/html/vendor/pimcore/pimcore/models/DataObject/AbstractObject.php(617): Pimcore\Model\Element\AbstractElement->dispatchEvent()
#7 /var/www/html/vendor/pimcore/pimcore/models/DataObject/Concrete.php(637): Pimcore\Model\DataObject\AbstractObject->save()
#8 /var/www/html/src/EventListener/WorkflowListenerProduct.php(348): Pimcore\Model\DataObject\Concrete->save()
#9 /var/www/html/src/EventListener/WorkflowListenerProduct.php(361): App\EventListener\WorkflowListenerProduct->setNamingConventionForProduct()
#10 /var/www/html/vendor/symfony/event-dispatcher/EventDispatcher.php(260): App\EventListener\WorkflowListenerProduct->onProductWorkflowEntered()
#11 /var/www/html/vendor/symfony/event-dispatcher/EventDispatcher.php(220): Symfony\Component\EventDispatcher\EventDispatcher::Symfony\Component\EventDispatcher\{closure}()
#12 /var/www/html/vendor/symfony/event-dispatcher/EventDispatcher.php(56): Symfony\Component\EventDispatcher\EventDispatcher->callListeners()
#13 /var/www/html/vendor/symfony/workflow/Workflow.php(392): Symfony\Component\EventDispatcher\EventDispatcher->dispatch()
#14 /var/www/html/vendor/symfony/workflow/Workflow.php(224): Symfony\Component\Workflow\Workflow->entered()
#15 /var/www/html/vendor/pimcore/pimcore/lib/Workflow/Manager.php(230): Symfony\Component\Workflow\Workflow->apply()
#16 /var/www/html/vendor/pimcore/admin-ui-classic-bundle/src/Controller/Admin/WorkflowController.php(111): Pimcore\Workflow\Manager->applyWithAdditionalData()
#17 /var/www/html/vendor/symfony/http-kernel/HttpKernel.php(181): Pimcore\Bundle\AdminBundle\Controller\Admin\WorkflowController->submitWorkflowTransitionAction()
#18 /var/www/html/vendor/symfony/http-kernel/HttpKernel.php(76): Symfony\Component\HttpKernel\HttpKernel->handleRaw()
#19 /var/www/html/vendor/symfony/http-kernel/Kernel.php(197): Symfony\Component\HttpKernel\HttpKernel->handle()
#20 /var/www/html/public/index.php(48): Symfony\Component\HttpKernel\Kernel->handle()
Strange thing, has been like that since ages. We need to investigate why though. My first guess is to update the workspace definitions when a folder (or object) gets moved/renamed. But saving the whole configuration in that case also feels somehow wrong - especially when they are in yaml files and cannot be updated.
Related PR: https://github.com/pimcore/data-hub/pull/117
Any inputs welcome.
TL; DR Yes, it looks like Pimcore DataHub updates the object paths listed on Datahub workspace when an object moves.
A few thoughts:
- This should not run on yaml files
- This logic is in general a bit magical. Perhaps it should be an opt in setting on the workspace config. I had no idea this was even happening.
- Are there performance concerns as the list of datahub configs grows? We have quite a few exporters and importers and I am getting worried at all of the logic that runs (synchronously) each time an object is updated (or moved) e.g. we are going to be moving 100k+ objects soon and I would like toe be reasonably fast