Index: branches/5.1.x/core/install/upgrades.php =================================================================== diff -u -N -r14241 -r14327 --- branches/5.1.x/core/install/upgrades.php (.../upgrades.php) (revision 14241) +++ branches/5.1.x/core/install/upgrades.php (.../upgrades.php) (revision 14327) @@ -1,6 +1,6 @@ ' $new_tag) { - $sql = 'UPDATE '.TABLE_PREFIX.'EmailMessage - SET Template = REPLACE(Template, '.$this->Conn->qstr($old_tag).', '.$this->Conn->qstr($new_tag).') - WHERE EventId IN ('.$event_ids.')'; - $this->Conn->Query($sql); + if ($event_ids) { + foreach ($replacements as $old_tag => $new_tag) { + $sql = 'UPDATE '.TABLE_PREFIX.'EmailMessage + SET Template = REPLACE(Template, '.$this->Conn->qstr($old_tag).', '.$this->Conn->qstr($new_tag).') + WHERE EventId IN ('.$event_ids.')'; + $this->Conn->Query($sql); + } } if ($mode == 'after') {