-
-
Notifications
You must be signed in to change notification settings - Fork 7
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
Cannot assign array to property verbb\scheduler\models\Job::$settings of type ?string #5
Comments
We have recently run into this issue, too. It appears to be from the model expecting the type to be a string and the code setting it as an array at a couple spots in src/services/Jobs.php. The addJob function, we moved The next change was in _createJobFromRecord function, we removed the last if statement and are just returning the job now, so it looks like this:
I don't recommend editing vendor files because changes will get overwritten, but if you can fork off of this or have another way of doing these until they fix these themselves, then that would be best. |
I'm also having this issue, but sort of in the opposite direction! I'm adding a custom job from a plugin controller as described in the docs and getting an error because I'm passing in |
I have this same issue. Any sense of timing for a fix? Or am I better off switching to a different solution? |
Same issue here. A simple fix with just the model fix on setting the $settings as an array not a string would be highly appriciated. |
Describe the bug
When saving an entry I get this error.
TypeError: Cannot assign array to property verbb\scheduler\models\Job::$settings of type ?string in /var/www/vendor/verbb/scheduler/src/services/Jobs.php:159
Looks like the settings are getting passed as an array but it's expecting a string?
Steps to reproduce
Craft CMS version
4.5.5
Plugin version
3.0.0
Multi-site?
No
Additional context
Complete stack trace here:
TypeError: Cannot assign array to property verbb\scheduler\models\Job::$settings of type ?string in /var/www/vendor/verbb/scheduler/src/services/Jobs.php:159
Stack trace:
#0 /var/www/vendor/verbb/scheduler/src/Scheduler.php(109): verbb\scheduler\services\Jobs->addJob('verbb\scheduler...', Object(DateTime), 'programmatic:17...', Array)
#1 [internal function]: verbb\scheduler\Scheduler->verbb\scheduler{closure}(Object(craft\events\ElementEvent))
#2 /var/www/vendor/yiisoft/yii2/base/Event.php(312): call_user_func(Object(Closure), Object(craft\events\ElementEvent))
#3 /var/www/vendor/yiisoft/yii2/base/Component.php(642): yii\base\Event::trigger('craft\services\...', 'afterSaveElemen...', Object(craft\events\ElementEvent))
#4 /var/www/vendor/craftcms/cms/src/services/Elements.php(3503): yii\base\Component->trigger('afterSaveElemen...', Object(craft\events\ElementEvent))
#5 /var/www/vendor/craftcms/cms/src/services/Elements.php(1097): craft\services\Elements->_saveElementInternal(Object(craft\elements\Entry), true, false, true, Array, false, false)
#6 /var/www/vendor/craftcms/cms/src/controllers/ElementsController.php(1051): craft\services\Elements->saveElement(Object(craft\elements\Entry), true, true, NULL, false, false)
#7 [internal function]: craft\controllers\ElementsController->actionSave()
#8 /var/www/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)
#9 /var/www/vendor/yiisoft/yii2/base/Controller.php(178): yii\base\InlineAction->runWithParams(Array)
#10 /var/www/vendor/yiisoft/yii2/base/Module.php(552): yii\base\Controller->runAction('save', Array)
#11 /var/www/vendor/craftcms/cms/src/web/Application.php(304): yii\base\Module->runAction('elements/save', Array)
#12 /var/www/vendor/craftcms/cms/src/web/Application.php(607): craft\web\Application->runAction('elements/save', Array)
#13 /var/www/vendor/craftcms/cms/src/web/Application.php(283): craft\web\Application->_processActionRequest(Object(craft\web\Request))
#14 /var/www/vendor/yiisoft/yii2/base/Application.php(384): craft\web\Application->handleRequest(Object(craft\web\Request))
#15 /var/www/web/index.php(12): yii\base\Application->run()
#16 {main}
The text was updated successfully, but these errors were encountered: