]> dev.renevier.net Git - syj.git/blobdiff - application/models/PathMapper.php
fixes php warning when uploading a file without being logged
[syj.git] / application / models / PathMapper.php
index 1e0e973c4489dc0e1bb9673cefcbeb30c949a72d..7f43e2239b64bae6d1187c9ea1c44f6571d77059 100644 (file)
@@ -1,5 +1,5 @@
 <?php
-/*  This file is part of Syj, Copyright (c) 2010 Arnaud Renevier,
+/*  This file is part of Syj, Copyright (c) 2010-2011 Arnaud Renevier,
     and is published under the AGPL license. */
 
 class Syj_Model_PathMapper
@@ -25,7 +25,6 @@ class Syj_Model_PathMapper
         $db = $this->getDbTable()->getAdapter();
         $expr = $db->quoteInto('seq_attained_value(?)', array('paths_id_seq', (int)$id));
         $select = $db->select()->from(new Zend_Db_Expr($expr));
-        print $select->assemble();
         $row = $db->fetchRow($select);
         return $row['t'];
     }
@@ -67,7 +66,7 @@ class Syj_Model_PathMapper
     public function save (Syj_Model_Path $path) {
         $data = array(
             'geom'=> (string)$path->geom,
-            'creator'=> $path->creator->id,
+            'creator'=> $path->creator? $path->creator->id: null,
             'title'=> $path->title,
             'creator_ip'=> $path->creatorIp
         );