]> git.mxchange.org Git - friendica.git/blobdiff - src/Database/PostUpdate.php
Merge pull request #8804 from MrPetovan/bug/warnings
[friendica.git] / src / Database / PostUpdate.php
index a3b967d3bf43be097cb34212bf66654d9f3521b8..0ceae07f708e18a66b2eaab8cc912d80c63022e6 100644 (file)
@@ -831,7 +831,7 @@ class PostUpdate
        }
 
        /**
-        * update the "vid" (verb) field in the item table 
+        * update the "vid" (verb) field in the item table
         *
         * @return bool "true" when the job is done
         * @throws \Friendica\Network\HTTPException\InternalServerErrorException
@@ -851,10 +851,10 @@ class PostUpdate
                $start_id = $id;
                $rows = 0;
 
-               $items = DBA::p("SELECT `item`.`id`, `item`.`vid`, `item`.`verb` AS `item-verb`, `item-content`.`verb`, `item-activity`.`activity`
+               $items = DBA::p("SELECT `item`.`id`, `item`.`verb` AS `item-verb`, `item-content`.`verb`, `item-activity`.`activity`
                        FROM `item` LEFT JOIN `item-content` ON `item-content`.`uri-id` = `item`.`uri-id`
                        LEFT JOIN `item-activity` ON `item-activity`.`uri-id` = `item`.`uri-id` AND `item`.`gravity` = ?
-                       WHERE `item`.`id` >= ? ORDER BY `item`.`id` LIMIT 10000", GRAVITY_ACTIVITY, $id);
+                       WHERE `item`.`id` >= ? AND `item`.`vid` IS NULL ORDER BY `item`.`id` LIMIT 10000", GRAVITY_ACTIVITY, $id);
 
                if (DBA::errorNo() != 0) {
                        Logger::error('Database error', ['no' => DBA::errorNo(), 'message' => DBA::errorMessage()]);
@@ -893,7 +893,7 @@ class PostUpdate
        }
 
        /**
-        * update the "gsid" (global server id) field in the contact table 
+        * update the "gsid" (global server id) field in the contact table
         *
         * @return bool "true" when the job is done
         * @throws \Friendica\Network\HTTPException\InternalServerErrorException
@@ -925,7 +925,7 @@ class PostUpdate
                        $id = $contact['id'];
 
                        DBA::update('contact',
-                               ['gsid' => GServer::getID($contact['baseurl']), 'baseurl' => GServer::cleanURL($contact['baseurl'])],
+                               ['gsid' => GServer::getID($contact['baseurl'], true), 'baseurl' => GServer::cleanURL($contact['baseurl'])],
                                ['id' => $contact['id']]);
 
                        ++$rows;
@@ -946,7 +946,7 @@ class PostUpdate
        }
 
        /**
-        * update the "gsid" (global server id) field in the apcontact table 
+        * update the "gsid" (global server id) field in the apcontact table
         *
         * @return bool "true" when the job is done
         * @throws \Friendica\Network\HTTPException\InternalServerErrorException
@@ -959,7 +959,7 @@ class PostUpdate
                        return true;
                }
 
-               $id = DI::config()->get("system", "post_update_version_1349_id", 0);
+               $id = DI::config()->get("system", "post_update_version_1349_id", '');
 
                Logger::info('Start', ['apcontact' => $id]);
 
@@ -978,7 +978,7 @@ class PostUpdate
                        $id = $apcontact['url'];
 
                        DBA::update('apcontact',
-                               ['gsid' => GServer::getID($apcontact['baseurl']), 'baseurl' => GServer::cleanURL($apcontact['baseurl'])],
+                               ['gsid' => GServer::getID($apcontact['baseurl'], true), 'baseurl' => GServer::cleanURL($apcontact['baseurl'])],
                                ['url' => $apcontact['url']]);
 
                        ++$rows;
@@ -999,7 +999,7 @@ class PostUpdate
        }
 
        /**
-        * update the "gsid" (global server id) field in the gcontact table 
+        * update the "gsid" (global server id) field in the gcontact table
         *
         * @return bool "true" when the job is done
         * @throws \Friendica\Network\HTTPException\InternalServerErrorException
@@ -1031,7 +1031,7 @@ class PostUpdate
                        $id = $gcontact['id'];
 
                        DBA::update('gcontact',
-                               ['gsid' => GServer::getID($gcontact['server_url']), 'server_url' => GServer::cleanURL($gcontact['server_url'])],
+                               ['gsid' => GServer::getID($gcontact['server_url'], true), 'server_url' => GServer::cleanURL($gcontact['server_url'])],
                                ['id' => $gcontact['id']]);
 
                        ++$rows;