diff options
Diffstat (limited to 'mod/bookmarks')
-rw-r--r-- | mod/bookmarks/lib/bookmarks.php | 11 | ||||
-rw-r--r-- | mod/bookmarks/views/default/forms/bookmarks/save.php | 2 |
2 files changed, 8 insertions, 5 deletions
diff --git a/mod/bookmarks/lib/bookmarks.php b/mod/bookmarks/lib/bookmarks.php index 815330e2c..9a9dff18c 100644 --- a/mod/bookmarks/lib/bookmarks.php +++ b/mod/bookmarks/lib/bookmarks.php @@ -14,7 +14,7 @@ function bookmarks_prepare_form_vars($bookmark = null) { // input names => defaults $values = array( - 'title' => get_input('title', ''), + 'title' => get_input('title', ''), // bookmarklet support 'address' => get_input('address', ''), 'description' => '', 'access_id' => ACCESS_DEFAULT, @@ -27,13 +27,16 @@ function bookmarks_prepare_form_vars($bookmark = null) { if ($bookmark) { foreach (array_keys($values) as $field) { - $values[$field] = $bookmark->$field; + if (isset($bookmark->$field)) { + $values[$field] = $bookmark->$field; + } } } if (elgg_is_sticky_form('bookmarks')) { - foreach (array_keys($values) as $field) { - $values[$field] = elgg_get_sticky_value('bookmarks', $field); + $sticky_values = elgg_get_sticky_values('bookmarks'); + foreach ($sticky_values as $key => $value) { + $values[$key] = $value; } } diff --git a/mod/bookmarks/views/default/forms/bookmarks/save.php b/mod/bookmarks/views/default/forms/bookmarks/save.php index 4930aacdb..886283202 100644 --- a/mod/bookmarks/views/default/forms/bookmarks/save.php +++ b/mod/bookmarks/views/default/forms/bookmarks/save.php @@ -5,7 +5,7 @@ * @package Bookmarks */ -// once elgg_view stops throwing all sorts of junk into $vars, we can use +// once elgg_view stops throwing all sorts of junk into $vars, we can use extract() $title = elgg_extract('title', $vars, ''); $desc = elgg_extract('description', $vars, ''); $address = elgg_extract('address', $vars, ''); |