]> git.mxchange.org Git - friendica.git/commitdiff
Fix: Ensure that the value is set.
authorMichael <heluecht@pirati.ca>
Sat, 7 Jul 2018 19:39:00 +0000 (19:39 +0000)
committerMichael <heluecht@pirati.ca>
Sat, 7 Jul 2018 19:39:00 +0000 (19:39 +0000)
src/Model/Item.php

index 87ea80005eedb72bdaf6a9184664ee20d0d45a20..4a7d8639d5f56fb8b9cae64790065d68b57ac649 100644 (file)
@@ -752,7 +752,7 @@ class Item extends BaseObject
                        if (!empty($item['plink'])) {
                                $content_fields['plink'] = $item['plink'];
                        }
-                       if ((self::activityToIndex($item['verb']) >= 0) || !empty($item['iaid'])) {
+                       if (!empty($item['iaid']) || (!empty($content_fields['verb']) && (self::activityToIndex($content_fields['verb']) >= 0))) {
                                self::updateActivity($content_fields, ['uri' => $item['uri']]);
 
                                if (empty($item['iaid'])) {
@@ -768,6 +768,12 @@ class Item extends BaseObject
                                                        dba::delete('item-content', ['id' => $item['icid']]);
                                                }
                                        }
+                               } elseif (!empty($item['icid'])) {
+                                       dba::update('item', ['icid' => null], ['id' => $item['id']]);
+
+                                       if (!dba::exists('item', ['icid' => $item['icid']])) {
+                                               dba::delete('item-content', ['id' => $item['icid']]);
+                                       }
                                }
                        } else {
                                self::updateContent($content_fields, ['uri' => $item['uri']]);