@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 reading ad-hoc settings with no formal Settings object

Summary:
Ref T4103. Some settings (like the collapsed/expanded state of the diff filetree) are currently ad-hoc. They weren't being read correctly.

Also, simplify the caching code a little bit.

Test Plan: Toggled filetree, reloaded page, got sticky behavior.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T4103

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

+11 -8
+11 -8
src/applications/people/storage/PhabricatorUser.php
··· 505 505 ->setViewer($this) 506 506 ->assertValidValue($value); 507 507 508 - $this->settingCacheKeys[$key] = true; 509 - $this->settingCache[$key] = $value; 510 - 511 - return $value; 508 + return $this->writeUserSettingCache($key, $value); 512 509 } catch (Exception $ex) { 513 510 // Fall through below and return the default value. 514 511 } 512 + } else { 513 + // This is an ad-hoc setting with no controlling object. 514 + return $this->writeUserSettingCache($key, $value); 515 515 } 516 516 } 517 517 ··· 523 523 $value = null; 524 524 } 525 525 526 - $this->settingCacheKeys[$key] = true; 527 - $this->settingCache[$key] = $value; 528 - 529 - return $value; 526 + return $this->writeUserSettingCache($key, $value); 530 527 } 531 528 532 529 ··· 555 552 $this->clearCacheData($settings_key); 556 553 557 554 return $this; 555 + } 556 + 557 + private function writeUserSettingCache($key, $value) { 558 + $this->settingCacheKeys[$key] = true; 559 + $this->settingCache[$key] = $value; 560 + return $value; 558 561 } 559 562 560 563 public function getTranslation() {