Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

File upload 500 error: Typed property MonitoringItem::$id must not be accessed before initialization #200

Open
NiklasBr opened this issue Feb 16, 2024 · 0 comments

Comments

@NiklasBr
Copy link
Contributor

NiklasBr commented Feb 16, 2024

The below error appears when POST:ing a form to /admin/elementsprocessmanager/config/execute in Pimcore 11:

[2024-02-16T10:26:52.004048+01:00] request.CRITICAL: Uncaught PHP Exception Error: "Typed property Elements\Bundle\ProcessManagerBundle\Model\MonitoringItem::$id must not be accessed before initialization" at MonitoringItem.php line 380 {"exception":"[object] (Error(code: 0): Typed property Elements\\Bundle\\ProcessManagerBundle\\Model\\MonitoringItem::$id must not be accessed before initialization at /var/www/pimcore/vendor/elements/process-manager-bundle/src/Model/MonitoringItem.php:380)"} []

Edit, full trace:

#0 /var/www/pimcore/vendor/elements/process-manager-bundle/src/Service/UploadManger.php(27): Elements\Bundle\ProcessManagerBundle\Model\MonitoringItem->getId()
#1 /var/www/pimcore/vendor/elements/process-manager-bundle/src/Controller/ConfigController.php(203): Elements\Bundle\ProcessManagerBundle\Service\UploadManger->saveUploads(Object(Symfony\Component\HttpFoundation\Request), Object(Elements\Bundle\ProcessManagerBundle\Model\MonitoringItem))
#2 /var/www/pimcore/vendor/elements/process-manager-bundle/src/Helper.php(74): Elements\Bundle\ProcessManagerBundle\Controller\ConfigController->Elements\Bundle\ProcessManagerBundle\Controller\{closure}(Object(Elements\Bundle\ProcessManagerBundle\Model\MonitoringItem), Object(Elements\Bundle\ProcessManagerBundle\Executor\PimcoreCommand))
#3 /var/www/pimcore/vendor/elements/process-manager-bundle/src/Controller/ConfigController.php(196): Elements\Bundle\ProcessManagerBundle\Helper::executeJob('5', Array, 2, Array, NULL, Object(Closure))
#4 /var/www/pimcore/vendor/symfony/http-kernel/HttpKernel.php(181): Elements\Bundle\ProcessManagerBundle\Controller\ConfigController->execute(Object(Symfony\Component\HttpFoundation\Request), Object(Elements\Bundle\ProcessManagerBundle\Service\UploadManger))
#5 /var/www/pimcore/vendor/symfony/http-kernel/HttpKernel.php(76): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1)
#6 /var/www/pimcore/vendor/symfony/http-kernel/Kernel.php(197): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#7 /var/www/pimcore/vendor/symfony/runtime/Runner/Symfony/HttpKernelRunner.php(35): Symfony\Component\HttpKernel\Kernel->handle(Object(Symfony\Component\HttpFoundation\Request))
#8 /var/www/pimcore/vendor/autoload_runtime.php(29): Symfony\Component\Runtime\Runner\Symfony\HttpKernelRunner->run()
#9 /var/www/pimcore/public/index.php(19): require_once('/var/www/pimcor...')
#10 {main}

It appears to happen at:

$callback($monitoringItem, $executor);

Adding a $monitoringItem->save(); just before that row fixes the situation. Not sure if it is the proper fix however.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant