Skip to content

A free open source IT asset/license management system

Catch potential validation errors on unescape tool

snipee4da00ca8247
diff --git a/app/Console/Commands/FixDoubleEscape.php b/app/Console/Commands/FixDoubleEscape.php
index ddd2b2670b..06f155dea9 100644
--- a/app/Console/Commands/FixDoubleEscape.php
+++ b/app/Console/Commands/FixDoubleEscape.php
@@ -72,8 +72,11 @@ class FixDoubleEscape extends Command
foreach($classname::where("$field",'LIKE','%&%')->get() as $row) {
$fixed = html_entity_decode($row->{$field});
- $this->info('Updating '.$field.' for '.$classname.' to '.$row->{$field}.' to '.$fixed);
- $row->save();
+ if ($row->save()) {
+ $this->info('Updating '.$field.' for '.$classname.' to '.$row->{$field}.' to '.$fixed);
+ } else {
+ $this->error('Could NOT update '.$field.' for '.$classname.' to '.$row->{$field}.' to '.$fixed.': '.$row->getErrors());
+ }
$count[$classname][$field]++;
}