diff --git a/include/items.php b/include/items.php index cbc7af565..f334990d7 100644 --- a/include/items.php +++ b/include/items.php @@ -1151,6 +1151,11 @@ function item_store($arr, $force_parent = false, $notify = false, $dontcache = f * @param array $arr Contains the just posted item record */ function item_set_last_item($arr) { + // Unarchive the author + $contact = dba::select('contact', [], ['id' => $arr["author-link"]], ['limit' => 1]); + if ($contact['term-date'] > NULL_DATE) { + Contact::unmarkForArchival($contact); + } $update = (!$arr['private'] && (($arr["author-link"] === $arr["owner-link"]) || ($arr["parent-uri"] === $arr["uri"]))); diff --git a/src/Object/Contact.php b/src/Object/Contact.php index fc1b26aba..bd7cee7fb 100644 --- a/src/Object/Contact.php +++ b/src/Object/Contact.php @@ -185,7 +185,7 @@ class Contact extends BaseObject */ public static function unmarkForArchival(array $contact) { - $condition = array('`id` = ? AND (`term-date` > ? OR `archive`)', $contact[`id`], NULL_DATE); + $condition = array('`id` = ? AND (`term-date` > ? OR `archive`)', $contact['id'], NULL_DATE); $exists = dba::exists('contact', $condition); // We don't need to update, we never marked this contact for archival