Skip to content
Snippets Groups Projects
Commit dc9e07f7 authored by Anas Mawlawi's avatar Anas Mawlawi Committed by saranya ashokkumar
Browse files

Issue #3346999 by Anas_maw, saranya ashokkumar: Update old entities any states value

parent 3082db18
Branches
Tags 3.0.0-beta2
No related merge requests found
<?php
/**
* @file
*/
/**
* Update empty (from_sid and to_side) to all.
*/
function workflow_notifications_update_8001(&$sandbox) {
$workflow_notify_storage = \Drupal::entityTypeManager()->getStorage('workflow_notify');
$rules = $workflow_notify_storage->loadByProperties(['from_sid' => '']);
foreach ($rules as $key => $rule) {
$rule->set('from_sid', 'all');
$rule->save();
}
$rules = $workflow_notify_storage->loadByProperties(['to_sid' => '']);
foreach ($rules as $key => $rule) {
$rule->set('to_sid', 'all');
$rule->save();
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment