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

Don't allow "Start Time" / "End Time" in Calendar event forms to be locked or have defaults assigned

Summary: Fixes T11733. This fixes the issue by working around it, but it isn't useful to set these fields to a default value anyway.

Test Plan: Created a default Calendar form, set some other defaults, created an event, stuff no longer exploded.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T11733

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

+14
+6
src/applications/calendar/editor/PhabricatorCalendarEventEditEngine.php
··· 164 164 165 165 if ($this->getIsCreate() || $object->getIsRecurring()) { 166 166 $fields[] = id(new PhabricatorEpochEditField()) 167 + ->setIsLockable(false) 168 + ->setIsDefaultable(false) 167 169 ->setAllowNull(true) 168 170 ->setKey('until') 169 171 ->setLabel(pht('Repeat Until')) ··· 189 191 $fields[] = id(new PhabricatorEpochEditField()) 190 192 ->setKey('start') 191 193 ->setLabel(pht('Start')) 194 + ->setIsLockable(false) 195 + ->setIsDefaultable(false) 192 196 ->setTransactionType( 193 197 PhabricatorCalendarEventStartDateTransaction::TRANSACTIONTYPE) 194 198 ->setDescription(pht('Start time of the event.')) ··· 199 203 $fields[] = id(new PhabricatorEpochEditField()) 200 204 ->setKey('end') 201 205 ->setLabel(pht('End')) 206 + ->setIsLockable(false) 207 + ->setIsDefaultable(false) 202 208 ->setTransactionType( 203 209 PhabricatorCalendarEventEndDateTransaction::TRANSACTIONTYPE) 204 210 ->setDescription(pht('End time of the event.'))
+8
src/applications/transactions/storage/PhabricatorEditEngineConfiguration.php
··· 128 128 129 129 $values = $this->getProperty('defaults', array()); 130 130 foreach ($fields as $key => $field) { 131 + if (!$field->getIsDefaultable()) { 132 + continue; 133 + } 131 134 if ($is_new) { 132 135 if (array_key_exists($key, $values)) { 133 136 $field->readDefaultValueFromConfiguration($values[$key]); ··· 155 158 // If we don't have an explicit value, don't make any adjustments. 156 159 break; 157 160 } 161 + } 162 + 163 + // If the field isn't lockable, remove any lock we applied. 164 + if (!$field->getIsLockable()) { 165 + $field->setIsLocked(false); 158 166 } 159 167 160 168 $fields = $this->reorderFields($fields);