@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

When a file is stored as chunks, show "Format: Chunks" instead of "Format: Raw"

Summary: Fixes T11712. This is somewhat misleading with encryption enabled.

Test Plan: Viewed chunked and unchunked files.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T11712

Differential Revision: https://secure.phabricator.com/D16636

+24 -12
+24 -12
src/applications/files/controller/PhabricatorFileInfoController.php
··· 285 285 pht('Engine'), 286 286 $file->getStorageEngine()); 287 287 288 - $format_key = $file->getStorageFormat(); 289 - $format = PhabricatorFileStorageFormat::getFormat($format_key); 290 - if ($format) { 291 - $format_name = $format->getStorageFormatName(); 288 + $engine = $this->loadStorageEngine($file); 289 + if ($engine && $engine->isChunkEngine()) { 290 + $format_name = pht('Chunks'); 292 291 } else { 293 - $format_name = pht('Unknown ("%s")', $format_key); 292 + $format_key = $file->getStorageFormat(); 293 + $format = PhabricatorFileStorageFormat::getFormat($format_key); 294 + if ($format) { 295 + $format_name = $format->getStorageFormatName(); 296 + } else { 297 + $format_name = pht('Unknown ("%s")', $format_key); 298 + } 294 299 } 295 300 $storage_properties->addProperty(pht('Format'), $format_name); 296 301 ··· 369 374 $box->addPropertyList($media); 370 375 } 371 376 372 - $engine = null; 373 - try { 374 - $engine = $file->instantiateStorageEngine(); 375 - } catch (Exception $ex) { 376 - // Don't bother raising this anywhere for now. 377 - } 378 - 377 + $engine = $this->loadStorageEngine($file); 379 378 if ($engine) { 380 379 if ($engine->isChunkEngine()) { 381 380 $chunkinfo = new PHUIPropertyListView(); ··· 435 434 } 436 435 437 436 } 437 + 438 + private function loadStorageEngine(PhabricatorFile $file) { 439 + $engine = null; 440 + 441 + try { 442 + $engine = $file->instantiateStorageEngine(); 443 + } catch (Exception $ex) { 444 + // Don't bother raising this anywhere for now. 445 + } 446 + 447 + return $engine; 448 + } 449 + 438 450 439 451 }