From 5106ca18bfbb2dbf37b615d95f802fe6b3286d64 Mon Sep 17 00:00:00 2001 From: garvinhicking Date: Mon, 30 May 2005 07:53:12 +0000 Subject: [PATCH] PGSql patch to properly detect isdraft state --- docs/NEWS | 3 +++ include/admin/entries.inc.php | 2 +- include/functions_entries.inc.php | 6 +++--- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/docs/NEWS b/docs/NEWS index b00b69a..6fb714d 100644 --- a/docs/NEWS +++ b/docs/NEWS @@ -3,6 +3,9 @@ Version 0.9 () ------------------------------------------------------------------------ + * Fix editing a draft article to be properly displayed as draft + in PostgreSQL setups. Thanks to Penny Leach! (garvinhicking) + * Localized the string "Reply" which occured inside some templates. (s/Reply/{$CONST.REPLY}/) (garvinhicking) diff --git a/include/admin/entries.inc.php b/include/admin/entries.inc.php index bb98e4e..0dbd19f 100644 --- a/include/admin/entries.inc.php +++ b/include/admin/entries.inc.php @@ -188,7 +188,7 @@ function serendipity_drawList() { $entry_pre = ''; } - if ($entry['isdraft'] == 'true') { + if (serendipity_db_bool($entry['isdraft'])) { $entry_pre .= ' ' . DRAFT . ': '; } ?> diff --git a/include/functions_entries.inc.php b/include/functions_entries.inc.php index de7df69..0c09c12 100644 --- a/include/functions_entries.inc.php +++ b/include/functions_entries.inc.php @@ -1037,7 +1037,7 @@ function serendipity_updertEntry($entry) { return $res; } - if ($entry['isdraft'] == 'false') { + if (!serendipity_db_bool($entry['isdraft'])) { serendipity_plugin_api::hook_event('frontend_display', $entry, array('no_scramble' => true)); serendipity_handle_references($entry['id'], $serendipity['blogTitle'], $entry['title'], $entry['body'] . $entry['extended'], $newEntry); } @@ -1046,7 +1046,7 @@ function serendipity_updertEntry($entry) { // Send publish tags if either a new article has been inserted from scratch, or if the entry was previously // stored as draft and is now published - if ($entry['isdraft'] == 'false' && ($newEntry || $_entry['isdraft'] == 'true')) { + if (!serendipity_db_bool($entry['isdraft']) && ($newEntry || serendipity_db_bool($_entry['isdraft']))) { serendipity_plugin_api::hook_event('backend_publish', $entry, $newEntry); } else { serendipity_plugin_api::hook_event('backend_save', $entry, $newEntry); @@ -1165,7 +1165,7 @@ function serendipity_printEntryForm($targetURL, $hiddens = array(), $entry = arr serendipity_plugin_api::hook_event('backend_entryform', $entry); - if ( (isset($entry['isdraft']) && $entry['isdraft'] == 'true') || + if ( (isset($entry['isdraft']) && serendipity_db_bool($entry['isdraft'])) || (!isset($entry['isdraft']) && $serendipity['publishDefault'] == 'draft') ) { $draftD = ' selected="selected"'; } else { -- 2.39.5