]> git.mxchange.org Git - friendica.git/blobdiff - src/Console/MergeContacts.php
update FR translations THX kalon33
[friendica.git] / src / Console / MergeContacts.php
index c3588545f478f22a1a62be364b75c7029ed7dc4a..543ad316e7f9fc48c3f92589282c1e9c9e58095a 100644 (file)
@@ -54,7 +54,7 @@ Description
 
 Options
        -h|--help|-? Show help information
-       -e|--execute Execute the dropping
+       -e|--execute Execute the merge
 HELP;
                return $help;
        }
@@ -63,8 +63,8 @@ HELP;
        {
                parent::__construct($argv);
 
-               $this->dba     = $dba;
-               $this->l10n    = $l10n;
+               $this->dba  = $dba;
+               $this->l10n = $l10n;
        }
 
        protected function doExecute()
@@ -73,6 +73,10 @@ HELP;
                while ($duplicate = $this->dba->fetch($duplicates)) {
                        $this->out($this->l10n->t('%d %s, %d duplicates.', $duplicate['uri-id'], $duplicate['url'], $duplicate['total']));
                        if ($this->getOption(['e', 'execute'], false)) {
+                               if (empty($duplicate['uri-id'])) {
+                                       $this->err($this->l10n->t('uri-id is empty for contact %s.', $duplicate['url']));
+                                       continue;
+                               }
                                $this->mergeContacts($duplicate['uri-id']);
                        }
                }
@@ -137,7 +141,7 @@ HELP;
                        $this->err($this->l10n->t('Deletion of id %d failed', $from));
                } else {
                        $this->out($this->l10n->t('Deletion of id %d was successful', $from));
-       }
+               }
        }
 
        private function updateTable(string $table, string $field, int $from, int $to, bool $in_unique_key)