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

Can't populate field from console command #90

Open
corneliusio opened this issue Mar 28, 2024 · 0 comments
Open

Can't populate field from console command #90

corneliusio opened this issue Mar 28, 2024 · 0 comments

Comments

@corneliusio
Copy link

I'm currently working on a content migration for a large site with a number of events. I've been stuck at trying to populate the Calendarize field on our events section in Craft CMS. After a number of hours not understanding why the field value I was providing simply seemed to silently fail I dug in and found this section of code at vendor/unionco/calendarize/src/services/CalendarizeService.php:308

if (
    !\Craft::$app->request->isConsoleRequest
    && \Craft::$app->request->isPost
    && $value
) {
    $model = new CalendarizeModel($owner, $value);
} else if ($record) {
    $model = new CalendarizeModel($owner, $record->getAttributes());
} else {
    $model = new CalendarizeModel($owner);
}

If I'm understanding the logic flow here, this would seem to mean you could never populate an entry programmatically with calendarize data from a console command at all. Is that correct? Or am I missing something else here?

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