[Solar-svn] Revision 2998

pmjones at solarphp.com pmjones at solarphp.com
Thu Mar 13 08:25:34 CDT 2008


Solar_App_Bookmarks: [CHG] In line with new Record save() boolean returns, remove try/catch blocks around save().


Modified: trunk/Solar/App/Bookmarks.php
===================================================================
--- trunk/Solar/App/Bookmarks.php	2008-03-13 01:49:46 UTC (rev 2997)
+++ trunk/Solar/App/Bookmarks.php	2008-03-13 13:25:34 UTC (rev 2998)
@@ -325,14 +325,9 @@
         $item->editor_handle = $this->user->auth->handle;
         
         // save?
-        if ($this->_isProcess('save')) {
-            try {
-                $item->save();
-                $this->_session->setFlash('add_ok', true);
-                $this->_redirect("bookmarks/edit/{$item->id}");
-            } catch (Solar_Sql_Model_Record_Exception_Invalid $e) {
-                // do nothing, the item form will show invalids
-            }
+        if ($this->_isProcess('save') && $item->save()) {
+            $this->_session->setFlash('add_ok', true);
+            $this->_redirect("bookmarks/edit/{$item->id}");
         }
         
         // cancel?
@@ -429,11 +424,7 @@
         // 
         
         if ($this->_isProcess('save')) {
-            try {
-                $item->save();
-            } catch (Solar_Sql_Model_Record_Exception_Invalid $e) {
-                // do nothing, the item form will show invalids
-            }
+            $item->save();
         }
         
         // cancel
@@ -524,14 +515,9 @@
         $item->editor_handle = $this->user->auth->handle;
         
         // save?
-        if ($this->_isProcess('save')) {
-            try {
-                $item->save();
-                $this->_session->setFlash('add_ok', true);
-                $this->_redirect("bookmarks/edit/{$item->id}");
-            } catch (Solar_Sql_Model_Record_Exception_Invalid $e) {
-                // do nothing, the item form will show invalids
-            }
+        if ($this->_isProcess('save') && $item->save()) {
+            $this->_session->setFlash('add_ok', true);
+            $this->_redirect("bookmarks/edit/{$item->id}");
         }
         
         // assign data for the view, and done
@@ -555,7 +541,7 @@
         $params = array(
             'where'  => array(
                 // only this area
-                'bookmarks.area_id = ?'      => $this->area->id,
+                'bookmarks.area_id = ?' => $this->area->id,
             ),
             'order'  => $this->_getSqlOrder(),
             'paging' => $this->_query('paging', 10),
@@ -572,7 +558,10 @@
         // flash forward the backlink in case we go to edit, but only if this
         // is a regular-format request
         if (! $this->_format) {
-            $this->_session->setFlash('backlink', $this->_request->server('REQUEST_URI'));
+            $this->_session->setFlash(
+                'backlink',
+                $this->_request->server('REQUEST_URI')
+            );
         }
         
         // assign the list of tags in use




More information about the Solar-svn mailing list