Beatnik: Fix duplicate message/false positive on autogenerate
authorBen Klang <ben@alkaloid.net>
Tue, 25 May 2010 18:09:30 +0000 (14:09 -0400)
committerBen Klang <ben@alkaloid.net>
Wed, 2 Jun 2010 19:22:20 +0000 (15:22 -0400)
beatnik/lib/Beatnik.php

index 3bc1610..4a8f51f 100644 (file)
@@ -565,10 +565,11 @@ class Beatnik {
                 }
                 try {
                     $result = $beatnik->driver->saveRecord(array_merge($defaults, $info));
+                    $GLOBALS['notification']->push(sprintf(_('Record added: %s/%s'), $rectype, $info['hostname']), 'horde.success');
                 } catch (Exception $e) {
                     $GLOBALS['notification']->push($e->getMessage(), 'horde.error');
+                    return false;
                 }
-                $GLOBALS['notification']->push(sprintf(_('Record added: %s/%s'), $rectype, $info['hostname']), 'horde.success');
             }
         }
         return true;