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

Improve remarkup metadata robustness against debris in the database

Summary:
Ref T13682. Versioned drafts may have missing or unexpected metadata:

- versioned drafts from an older version of Phabricator may be missing metadata;
- versioned drafts created by an older UI against a newer version of Phabricator may have `null` metadata.

Generally, make these workflows robust to metadata in unexpected formats, so database debris doesn't break the UI.

Test Plan: Simulated debris, interacted with UI.

Maniphest Tasks: T13682

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

+10 -1
+6 -1
src/applications/transactions/storage/PhabricatorApplicationTransaction.php
··· 244 244 ->setNewValue($new_value); 245 245 } 246 246 247 - $metadata = $this->getMetadataValue('remarkup.control', array()); 247 + $metadata = $this->getMetadataValue('remarkup.control'); 248 + 249 + if (!is_array($metadata)) { 250 + $metadata = array(); 251 + } 252 + 248 253 foreach ($changes as $change) { 249 254 if (!$change->getMetadata()) { 250 255 $change->setMetadata($metadata);
+4
src/applications/transactions/view/PhabricatorApplicationTransactionCommentView.php
··· 325 325 } 326 326 327 327 $remarkup_control->setValue($draft_comment); 328 + 329 + if (!is_array($draft_metadata)) { 330 + $draft_metadata = array(); 331 + } 328 332 $remarkup_control->setRemarkupMetadata($draft_metadata); 329 333 330 334 if (!$this->getObjectPHID()) {