function sanitize_webform_field in Webform Scheduled Tasks 8
Function to perform the DB Update.
1 call to sanitize_webform_field()
- webform_scheduled_tasks_do_actions in ./
webform_scheduled_tasks.module - Function that does the actions, must also be triggerable by a drush command.
File
- ./
webform_scheduled_tasks.module, line 61 - This hook will fire whenever cron fires, usually 20 mins.
Code
function sanitize_webform_field($field) {
$sanitizedValue = webform_scheduled_tasks_get_config('sanitized_value');
\Drupal::database()
->update('webform_submission_data')
->fields([
'value' => $sanitizedValue,
])
->condition('name', $field, '=')
->condition('value', $sanitizedValue, '<>')
->condition('value', '', '<>')
->execute();
}