Changeset 17869
- Timestamp:
- 10/02/08 14:36:24 (2 months ago)
- Files:
-
- trunk/midcom/midcom.core/midcom/baseclasses/core/dbobject.php (modified) (1 diff)
- trunk/midcom/midcom.core/midcom/services/dbclassloader.php (modified) (1 diff)
- trunk/midcom/org.routamc.photostream/handler/admin.php (modified) (3 diffs)
- trunk/midcom/org.routamc.photostream/handler/view.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/midcom/midcom.core/midcom/baseclasses/core/dbobject.php
r17803 r17869 1044 1044 { 1045 1045 $object->id = 0; 1046 1046 1047 if (is_object($id)) 1047 1048 { trunk/midcom/midcom.core/midcom/services/dbclassloader.php
r17558 r17869 617 617 parent::__construct(\$_id); 618 618 } 619 catch (midgard_error_exception \$e)619 catch (midgard_error_exception \$e) 620 620 { 621 621 \$x =& \$this; trunk/midcom/org.routamc.photostream/handler/admin.php
r17723 r17869 194 194 { 195 195 $this->_photo = new org_routamc_photostream_photo_dba($args[0]); 196 if (! $this->_photo) 196 if ( !$this->_photo 197 || empty($this->_photo->guid)) 197 198 { 198 199 $_MIDCOM->generate_error(MIDCOM_ERRNOTFOUND, "The photo {$args[0]} was not found."); … … 254 255 { 255 256 $this->_photo = new org_routamc_photostream_photo_dba($args[0]); 256 if (! $this->_photo) 257 if ( !$this->_photo 258 || empty($this->_photo->guid)) 257 259 { 258 260 $_MIDCOM->generate_error(MIDCOM_ERRNOTFOUND, "The photo {$args[0]} was not found."); … … 266 268 { 267 269 // Deletion confirmed. 268 if (! $this->_photo->delete()) 269 { 270 $_MIDCOM->generate_error(MIDCOM_ERRCRIT, "Failed to delete photo {$args[0]}, last Midgard error was: " . mgd_errstr()); 270 try 271 { 272 $this->_photo->delete(); 273 } 274 catch (midgard_error_exception $e) 275 { 276 $_MIDCOM->generate_error(MIDCOM_ERRCRIT, "Failed to delete photo {$args[0]}, last Midgard error was: " . $e->getMessage()); 271 277 // This will exit. 272 278 } trunk/midcom/org.routamc.photostream/handler/view.php
r17555 r17869 50 50 $data =& $this->_request_data; 51 51 $photo = new org_routamc_photostream_photo_dba($id); 52 if (!is_object($photo)) 53 { 54 $_MIDCOM->generate_error(MIDCOM_ERRCRIT, "Could not load photo {$id}"); 52 if ( !is_object($photo) 53 || empty($photo->guid)) 54 { 55 $_MIDCOM->generate_error(MIDCOM_ERRNOTFOUND, "Could not load photo {$id}"); 55 56 // This will exit 56 57 }
