diff --git a/app/Controller/LogsController.php b/app/Controller/LogsController.php index 329449d00..fdd2134cc 100644 --- a/app/Controller/LogsController.php +++ b/app/Controller/LogsController.php @@ -173,7 +173,7 @@ class LogsController extends AppController ) ); if (empty($event)) { - throw new MethodNotFoundException('Invalid event.'); + throw new NotFoundException('Invalid event.'); } $event = $event[0]; $attribute_ids = array(); diff --git a/app/Model/Attribute.php b/app/Model/Attribute.php index 8a4c1aa4e..2d9a0c944 100644 --- a/app/Model/Attribute.php +++ b/app/Model/Attribute.php @@ -4240,10 +4240,6 @@ class Attribute extends AppModel if ($paramsOnly) { return $params; } - if (!isset($this->validFormats[$returnFormat])) { - // this is where the new code path for the export modules will go - throw new MethodNotFoundException('Invalid export format.'); - } if (method_exists($exportTool, 'modify_params')) { $params = $exportTool->modify_params($user, $params); } diff --git a/app/Model/Event.php b/app/Model/Event.php index 4a6b520c5..ed2c7d417 100755 --- a/app/Model/Event.php +++ b/app/Model/Event.php @@ -2897,6 +2897,9 @@ class Event extends AppModel public function sendAlertEmail($id, $senderUser, $oldpublish = null, $processId = null) { $event = $this->fetchEvent($senderUser, array('eventid' => $id, 'includeAllTags' => true)); + if (empty($event)) { + throw new NotFoundException('Invalid Event.'); + } $this->NotificationLog = ClassRegistry::init('NotificationLog'); if (!$this->NotificationLog->check($event[0]['Event']['orgc_id'], 'publish')) { if ($processId) { @@ -2906,9 +2909,6 @@ class Event extends AppModel } return true; } - if (empty($event)) { - throw new MethodNotFoundException('Invalid Event.'); - } $userConditions = array('autoalert' => 1); $this->User = ClassRegistry::init('User'); $users = $this->User->getUsersWithAccess( diff --git a/app/Model/EventDelegation.php b/app/Model/EventDelegation.php index 1ce5821de..03e4330db 100644 --- a/app/Model/EventDelegation.php +++ b/app/Model/EventDelegation.php @@ -51,7 +51,7 @@ class EventDelegation extends AppModel { $event = $this->Event->fetchEvent($user, array('eventid' => $delegation['EventDelegation']['event_id'])); if (empty($event)) { - throw new MethodNotFoundException('Invalid event.'); + throw new NotFoundException('Invalid event.'); } $event = $event[0]; $event['Event']['user_id'] = $user['id']; diff --git a/app/Model/Sighting.php b/app/Model/Sighting.php index 67cf093ff..ef88696e1 100644 --- a/app/Model/Sighting.php +++ b/app/Model/Sighting.php @@ -574,7 +574,7 @@ class Sighting extends AppModel if (!isset($this->validFormats[$returnFormat])) { // this is where the new code path for the export modules will go - throw new MethodNotFoundException('Invalid export format.'); + throw new NotFoundException('Invalid export format.'); } $exportToolParams = array(