mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-23 05:50:55 +01:00
615d27c8e9
Summary: Depends on D19284. Ref T13110. It's now possible to get a revision into a "Abandoned + But, Never Promoted From Draft" state. Show this in the header and provide the draft hint above the comment area. Also, remove `shouldBroadcast()`. The method `getShouldBroadcast()` now has the same meaning. Finally, migrate existing drafts to `shouldBroadcast = false` and default `shouldBroadcast` to `true`. If we don't do this, every older revision becomes a non-broadcasting revision because this flag was not explicitly set on revision creation before, only on promotion out of draft. Test Plan: Ran migration; abandoned draft revisions and ended up in a draft + abandoned state. Subscribers: PHID-OPKG-gm6ozazyms6q6i22gyam Maniphest Tasks: T13110 Differential Revision: https://secure.phabricator.com/D19285
20 lines
505 B
PHP
20 lines
505 B
PHP
<?php
|
|
|
|
$table = new DifferentialRevision();
|
|
$conn = $table->establishConnection('w');
|
|
|
|
$drafts = $table->loadAllWhere(
|
|
'status = %s',
|
|
DifferentialRevisionStatus::DRAFT);
|
|
foreach ($drafts as $draft) {
|
|
$properties = $draft->getProperties();
|
|
|
|
$properties[DifferentialRevision::PROPERTY_SHOULD_BROADCAST] = false;
|
|
|
|
queryfx(
|
|
$conn,
|
|
'UPDATE %T SET properties = %s WHERE id = %d',
|
|
id(new DifferentialRevision())->getTableName(),
|
|
phutil_json_encode($properties),
|
|
$draft->getID());
|
|
}
|