Update of /cvsroot/php-blog/serendipity/include
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18882/include
Modified Files:
functions_entries.inc.php
Log Message:
fix loosing associated categories after POSTing
Index: functions_entries.inc.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/include/functions_entries.inc.php,v
retrieving revision 1.44
retrieving revision 1.45
diff -u -d -r1.44 -r1.45
--- functions_entries.inc.php 14 Jan 2005 12:28:17 -0000 1.44
+++ functions_entries.inc.php 17 Jan 2005 13:27:26 -0000 1.45
@@ -898,7 +898,7 @@
$entry['last_modified'] = time();
}
- /* WYSIWYG-editor inserts empty '<br />' for extended body; this is reversed here */
+ /* WYSIWYG-editor inserts empty ' ' for extended body; this is reversed here */
if (isset($entry['extended']) && trim($entry['extended']) == '') {
$entry['extended'] = '';
}
@@ -1131,6 +1131,15 @@
$allow_comments = '';
}
+ // Fix category list. If the entryForm is displayed after a POST request, the additional category information is lost.
+ if (is_array($entry['categories']) && !is_array($entry['categories'][0])) {
+ $categories = (array)$entry['categories'];
+ $entry['categories'] = array();
+ foreach ($categories as $catid) {
+ $entry['categories'][] = serendipity_fetchCategoryInfo($catid);
+ }
+ }
+
$n = "\n";
$cat_list = '<select id="categoryselector" name="serendipity[categories][]" style="vertical-align: middle;" multiple="multiple">' . $n;
$cat_list .= ' <option value="0">[' . NO_CATEGORY . ']</option>' . $n;
|