@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.

Fix `cancdn` vs `canCDN` flag

Summary:
Ref T5884. We migrated to add a `canCDN` flag, but the code looks for a `cancdn` flag.

If this fixes the issue, I'll migrate `cancdn` to `canCDN` in the next diff.

Test Plan: Viewed some files, including old files, and saw the cacheability I expected.

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: epriestley

Maniphest Tasks: T5884

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

+18 -4
+11 -3
src/applications/files/controller/PhabricatorFileInfoController.php
··· 213 213 pht('%s px', new PhutilNumber($height))); 214 214 } 215 215 216 - $finfo->addProperty( 217 - pht('Cacheable'), 218 - $file->getCanCDN() ? pht('Yes') : pht('No')); 216 + $is_image = $file->isViewableImage(); 217 + if ($is_image) { 218 + $image_string = pht('Yes'); 219 + $cache_string = $file->getCanCDN() ? pht('Yes') : pht('No'); 220 + } else { 221 + $image_string = pht('No'); 222 + $cache_string = pht('Not Applicable'); 223 + } 224 + 225 + $finfo->addProperty(pht('Viewable Image'), $image_string); 226 + $finfo->addProperty(pht('Cacheable'), $cache_string); 219 227 220 228 $storage_properties = new PHUIPropertyListView(); 221 229 $box->addPropertyList($storage_properties, pht('Storage'));
+7 -1
src/applications/files/storage/PhabricatorFile.php
··· 28 28 29 29 const METADATA_IMAGE_WIDTH = 'width'; 30 30 const METADATA_IMAGE_HEIGHT = 'height'; 31 - const METADATA_CAN_CDN = 'cancdn'; 31 + const METADATA_CAN_CDN = 'canCDN'; 32 32 33 33 protected $name; 34 34 protected $mimeType; ··· 848 848 if (!$this->isViewableImage()) { 849 849 return false; 850 850 } 851 + 852 + // TODO: Migrate away this old constant and remove this check. 853 + if (idx($this->metadata, 'cancdn')) { 854 + return true; 855 + } 856 + 851 857 return idx($this->metadata, self::METADATA_CAN_CDN); 852 858 } 853 859