1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-23 22:10:55 +01:00

Fix a CalendarExport issue when an existing export has an unsupported mode

Summary:
See D16676. When an export has an unsupported mode (bad database value, out-of-date object, etc) the intent of this code is to put it into the `<select />` so that you can save the form without silently changing the object.

However, it incorrectly calls `array_shift()` instead of `array_unshift()`.

Test Plan:
Edited a Calendar export with an invalid mode, saw the mode appear properly in the dropdown:

{F2957321}

Reviewers: vrana, chad

Reviewed By: vrana

Differential Revision: https://secure.phabricator.com/D17369
This commit is contained in:
epriestley 2017-02-16 06:18:23 -08:00
parent e0cd3062d5
commit 01f277cef2

View file

@ -70,7 +70,7 @@ final class PhabricatorCalendarExportEditEngine
$current_mode = $object->getPolicyMode();
if (empty($export_modes[$current_mode])) {
array_shift($export_modes, $current_mode);
array_unshift($export_modes, $current_mode);
}
$mode_options = array();