Catch potential validation errors on unescape tool

Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
snipe 2022-02-09 15:09:49 -08:00
parent 4fd14e5859
commit e4da00ca82

View file

@ -72,8 +72,11 @@ class FixDoubleEscape extends Command
foreach($classname::where("$field",'LIKE','%&%')->get() as $row) {
$fixed = html_entity_decode($row->{$field});
if ($row->save()) {
$this->info('Updating '.$field.' for '.$classname.' to '.$row->{$field}.' to '.$fixed);
$row->save();
} else {
$this->error('Could NOT update '.$field.' for '.$classname.' to '.$row->{$field}.' to '.$fixed.': '.$row->getErrors());
}
$count[$classname][$field]++;
}