]> git.mxchange.org Git - friendica.git/blobdiff - mod/item.php
Add tests for BBCode::fetchShareAttributes
[friendica.git] / mod / item.php
index 070934fb5021554d3d831f8b114349e881c11906..adfdc4cb0375812fe4346b2a135c36097c8c4b28 100644 (file)
@@ -621,6 +621,11 @@ function item_post(App $a) {
                $datarray["id"] = -1;
                $datarray["uri-id"] = -1;
                $datarray["author-network"] = Protocol::DFRN;
+               $datarray["author-updated"] = '';
+               $datarray["author-gsid"] = 0;
+               $datarray["author-uri-id"] = ItemURI::getIdByURI($datarray["author-link"]);
+               $datarray["owner-updated"] = '';
+               $datarray["has-media"] = false;
 
                $o = DI::conversation()->create([array_merge($contact_record, $datarray)], 'search', false, true);
 
@@ -663,21 +668,17 @@ function item_post(App $a) {
        $datarray['uri-id'] = ItemURI::getIdByURI($datarray['uri']);
 
        if ($orig_post) {
-               // Fill the cache field
-               // This could be done in Item::update as well - but we have to check for the existance of some fields.
-               Item::putInCache($datarray);
-
                $fields = [
                        'title' => $datarray['title'],
                        'body' => $datarray['body'],
                        'attach' => $datarray['attach'],
                        'file' => $datarray['file'],
-                       'rendered-html' => $datarray['rendered-html'],
-                       'rendered-hash' => $datarray['rendered-hash'],
                        'edited' => DateTimeFormat::utcNow(),
-                       'changed' => DateTimeFormat::utcNow()];
+                       'changed' => DateTimeFormat::utcNow()
+               ];
 
                Item::update($fields, ['id' => $post_id]);
+               Item::updateDisplayCache($datarray['uri-id']);
 
                if ($return_path) {
                        DI::baseUrl()->redirect($return_path);