diff options
Diffstat (limited to 'mod/blog')
-rw-r--r-- | mod/blog/actions/blog/save.php | 4 | ||||
-rw-r--r-- | mod/blog/lib/blog.php | 10 |
2 files changed, 10 insertions, 4 deletions
diff --git a/mod/blog/actions/blog/save.php b/mod/blog/actions/blog/save.php index dbbe25e04..18ddce786 100644 --- a/mod/blog/actions/blog/save.php +++ b/mod/blog/actions/blog/save.php @@ -6,7 +6,7 @@ */ // start a new sticky form session in case of failure -//elgg_make_sticky_form(); +elgg_make_sticky_form('blog'); // store errors to pass along $error = FALSE; @@ -129,7 +129,7 @@ if (!$error) { if (!$error) { if ($blog->save()) { // remove sticky form entries - elgg_clear_sticky_form(); + elgg_clear_sticky_form('blog'); // remove autosave draft if exists $blog->clearAnnotations('blog_auto_save'); diff --git a/mod/blog/lib/blog.php b/mod/blog/lib/blog.php index 861f75f95..326b224bb 100644 --- a/mod/blog/lib/blog.php +++ b/mod/blog/lib/blog.php @@ -361,6 +361,14 @@ function blog_prepare_form_vars($post = NULL, $revision = NULL) { 'draft_warning' => '', ); + if (elgg_is_sticky_form('blog')) { + foreach (array_keys($values) as $field) { + $values[$field] = elgg_get_sticky_value('blog', $field); + } + } + + elgg_clear_sticky_form('blog'); + if (!$post) { return $values; } @@ -389,8 +397,6 @@ function blog_prepare_form_vars($post = NULL, $revision = NULL) { $values['draft_warning'] = elgg_echo('blog:messages:warning:draft'); } - elgg_clear_sticky_form('blog'); - return $values; } |