]> git.mxchange.org Git - friendica.git/blobdiff - mod/item.php
Move share content conversion before link handling in Text\BBCode::convert
[friendica.git] / mod / item.php
index 85883914fadc7ee06fd0a50af6775a328ae4552f..6671d9439335e8c91be42923fd189269e5fa32d4 100644 (file)
@@ -119,7 +119,7 @@ function item_post(App $a) {
                        // The URI and the contact is taken from the direct parent which needn't to be the top parent
                        $thr_parent_uri = $toplevel_item['uri'];
 
-                       if ($toplevel_item['id'] != $toplevel_item['parent']) {
+                       if ($toplevel_item['gravity'] != GRAVITY_PARENT) {
                                $toplevel_item = Item::selectFirst([], ['id' => $toplevel_item['parent']]);
                        }
                }
@@ -650,6 +650,7 @@ function item_post(App $a) {
                // We set the datarray ID to -1 because in preview mode the dataray
                // doesn't have an ID.
                $datarray["id"] = -1;
+               $datarray["uri-id"] = -1;
                $datarray["item_id"] = -1;
                $datarray["author-network"] = Protocol::DFRN;
 
@@ -720,7 +721,8 @@ function item_post(App $a) {
                if ($return_path) {
                        DI::baseUrl()->redirect($return_path);
                }
-               throw new HTTPException\InternalServerErrorException(DI::l10n()->t('Item wasn\'t stored. Last database error: %d %s', DBA::errorNo(), dba::errorMessage()));
+
+               throw new HTTPException\InternalServerErrorException(DI::l10n()->t('Item wasn\'t stored.'));
        }
 
        $datarray = Item::selectFirst(Item::ITEM_FIELDLIST, ['id' => $post_id]);