From 34ce75c71d37754fa941233c805c042a47910184 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Thu, 27 Aug 2009 20:09:07 -0700 Subject: remove duplicate save of Notice and streamline attachment detection --- classes/Notice.php | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) (limited to 'classes/Notice.php') diff --git a/classes/Notice.php b/classes/Notice.php index e59712864..28d5b8ddf 100644 --- a/classes/Notice.php +++ b/classes/Notice.php @@ -58,7 +58,7 @@ class Notice extends Memcached_DataObject /* the code above is auto generated do not remove the tag below */ ###END_AUTOCODE - /* Notice types */ + /* Notice types */ const LOCAL_PUBLIC = 1; const REMOTE_OMB = 0; const LOCAL_NONPUBLIC = -1; @@ -248,17 +248,6 @@ class Notice extends Memcached_DataObject $notice->saveUrls(); - // FIXME: why do we have to re-render the content? - // Remove this if it's not necessary. - - $orig2 = clone($notice); - - $notice->rendered = common_render_content($final, $notice); - if (!$notice->update($orig2)) { - common_log_db_error($notice, 'UPDATE', __FILE__); - return _('Problem saving notice.'); - } - $notice->query('COMMIT'); Event::handle('EndNoticeSave', array($notice)); -- cgit v1.2.3-54-g00ecf From e277c856d65885a487b4d7f090a10cf817da836a Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Fri, 28 Aug 2009 20:00:55 +1200 Subject: fix for SQL error: ERROR: syntax error at or near ")" at character 45 http://laconi.ca/trac/ticket/1735 --- classes/Notice.php | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'classes/Notice.php') diff --git a/classes/Notice.php b/classes/Notice.php index 28d5b8ddf..89afe9d1d 100644 --- a/classes/Notice.php +++ b/classes/Notice.php @@ -732,6 +732,10 @@ class Notice extends Memcached_DataObject return new ArrayWrapper($notices); } else { $notice = new Notice(); + if (empty($ids)) { + //if no IDs requested, just return the notice object + return $notice; + } $notice->whereAdd('id in (' . implode(', ', $ids) . ')'); $notice->orderBy('id DESC'); -- cgit v1.2.3-54-g00ecf