- 🇬🇵Guadeloupe Monster971
Is it possible to update webform submissions via the cron without the changedTime date being updated?
Hi,
I'm trying to send email to my registered users end of the who is not paid. So that I created a hook_cron, In that trying to Load all submissions of the specific webform using entityQuery.
And then based on a field status trying to send an email to user then change the status of the field. In this case, I can able to run this cron manually, But while running through automatic cron it doesn't work.
What I understand is automatic cron will run as an anonymous user, So it couldn't load webform submissions. If I'm right Please help me to find out the right way to load all webform submissions and update it later. Please check the sample code below. thank you in advance.
$query = \Drupal::entityQuery('webform_submission')
->condition('webform_id', 'example_webform_name');
$result = $query->execute();
$storage = \Drupal::entityTypeManager()->getStorage('webform_submission');
$submissions = $storage->loadMultiple($result);
$submission_data = array();
foreach ($submissions as $submission) {
$submission_data[] = $submission->getData();
}
foreach ($submission_data as $data)
{
//rest of functions.
}
Closed: works as designed
6.1
Code
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.
Is it possible to update webform submissions via the cron without the changedTime date being updated?