diff --git a/src/applications/files/engine/PhabricatorChunkedFileStorageEngine.php b/src/applications/files/engine/PhabricatorChunkedFileStorageEngine.php index 1bb86cf67e..30de63b904 100644 --- a/src/applications/files/engine/PhabricatorChunkedFileStorageEngine.php +++ b/src/applications/files/engine/PhabricatorChunkedFileStorageEngine.php @@ -129,7 +129,7 @@ final class PhabricatorChunkedFileStorageEngine foreach ($chunks as $chunk) { $chunk->save(); } - $file->save(); + $file->saveAndIndex(); $file->saveTransaction(); return $file; diff --git a/src/applications/files/storage/PhabricatorFile.php b/src/applications/files/storage/PhabricatorFile.php index f697be0dc2..1c9b96069d 100644 --- a/src/applications/files/storage/PhabricatorFile.php +++ b/src/applications/files/storage/PhabricatorFile.php @@ -148,6 +148,12 @@ final class PhabricatorFile extends PhabricatorFileDAO return parent::save(); } + public function saveAndIndex() { + $this->save(); + PhabricatorSearchWorker::queueDocumentForIndexing($this->getPHID()); + return $this; + } + public function getMonogram() { return 'F'.$this->getID(); } @@ -234,7 +240,7 @@ final class PhabricatorFile extends PhabricatorFileDAO $new_file->readPropertiesFromParameters($params); - $new_file->save(); + $new_file->saveAndIndex(); return $new_file; } @@ -390,7 +396,7 @@ final class PhabricatorFile extends PhabricatorFileDAO // Do nothing } - $file->save(); + $file->saveAndIndex(); return $file; } diff --git a/src/applications/files/uploadsource/PhabricatorFileUploadSource.php b/src/applications/files/uploadsource/PhabricatorFileUploadSource.php index 0ef33a2521..cda07d590b 100644 --- a/src/applications/files/uploadsource/PhabricatorFileUploadSource.php +++ b/src/applications/files/uploadsource/PhabricatorFileUploadSource.php @@ -145,7 +145,7 @@ abstract class PhabricatorFileUploadSource } $file = PhabricatorFile::newChunkedFile($engine, $length, $parameters); - $file->save(); + $file->saveAndIndex(); $rope = $this->getRope();