]> git.mxchange.org Git - friendica.git/blobdiff - src/Module/Filer/SaveTag.php
Fix: The "extid" field wasn't updated
[friendica.git] / src / Module / Filer / SaveTag.php
index a396c17707b5cafff510534d51ef1946c8b1fbe3..013ff565a5b5958a14dff3b29011f42f7ba1fe9b 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * @copyright Copyright (C) 2020, Friendica
+ * @copyright Copyright (C) 2010-2021, the Friendica project
  *
  * @license GNU AGPL version 3 or any later version
  *
@@ -23,8 +23,10 @@ namespace Friendica\Module\Filer;
 
 use Friendica\BaseModule;
 use Friendica\Core\Renderer;
+use Friendica\Database\DBA;
 use Friendica\DI;
 use Friendica\Model;
+use Friendica\Network\HTTPException;
 use Friendica\Util\XML;
 
 /**
@@ -52,8 +54,11 @@ class SaveTag extends BaseModule
                $logger->info('filer', ['tag' => $term, 'item' => $item_id]);
 
                if ($item_id && strlen($term)) {
-                       // file item
-                       Model\FileTag::saveFile(local_user(), $item_id, $term);
+                       $item = Model\Post::selectFirst(['uri-id'], ['id' => $item_id]);
+                       if (!DBA::isResult($item)) {
+                               throw new HTTPException\NotFoundException();
+                       }
+                       Model\Post\Category::storeFileByURIId($item['uri-id'], local_user(), Model\Post\Category::FILE, $term);
                }
 
                // return filer dialog