-
Notifications
You must be signed in to change notification settings - Fork 37
Description
Problem reason
With Pimcore 10 and ProcessManager 4.x there might be monitoring objects in the database without metaData which results in an empty string. In my case this was caused by an command executed via cron job where the code segment
$monitoringId = $input->getOption('monitoring-item-id');
$options = ['autoCreate' => true];
$monitoringItem = $this->initProcessManager($monitoringId, $options);
created such an monitoringItem if no monitoring-item-id was passed.
Problem effect
However, when having such objects in database you will find the error
php.CRITICAL: Uncaught Error: Elements\Bundle\ProcessManagerBundle\Model\MonitoringItem::setMetaData(): Argument #1 ($metaData) must be of type array, null given, called in .../vendor/pimcore/pimcore/lib/Model/AbstractModel.php on line 186
in your log files as since ProcessManager 5.x this parameter is mandatory array. ProcessManager will not load the Process Log
Possible solution
You easily can overcome this issue by running
UPDATE bundle_process_manager_monitoring_item SET `metaData` = "[]" WHERE `metaData` = ''
SQL command on the database.
This could also be put in a migration script or if it's not worth the effort (seems not to happen frequently on migrations as there was no issue raised up to now) you can close this issue as it's anyhow documented here how to solve the problem