newmessage (and Message class) fixed for FormAction

Also added a needLogin function to the Action class, which will do
redirect to login page with proper returnto setting.
This commit is contained in:
Mikael Nordfeldth
2013-09-02 10:59:02 +02:00
parent 89b10666bb
commit e5e3aeb4e6
5 changed files with 31 additions and 69 deletions

View File

@@ -96,7 +96,7 @@ class Message extends Managed_DataObject
if (!$result) {
common_log_db_error($msg, 'INSERT', __FILE__);
// TRANS: Message given when a message could not be stored on the server.
return _('Could not insert message.');
throw new ServerException(_('Could not insert message.'));
}
$orig = clone($msg);
@@ -107,7 +107,7 @@ class Message extends Managed_DataObject
if (!$result) {
common_log_db_error($msg, 'UPDATE', __FILE__);
// TRANS: Message given when a message could not be updated on the server.
return _('Could not update message with new URI.');
throw new ServerException(_('Could not update message with new URI.'));
}
return $msg;