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

Calendar: fix creation of ICS Files

Summary:
It seems that, in an attempt to make ICS URI(s) editable, we broke the ability
to manually import ICS files. Whops.

The cause is, the URI needs to be put inside its dedicated import engine,
and not the general one.

Since the intention of T15137 was to be able to edit this field, we have done
that in the right way this time. So, you see the field, not just in creation mode.

Thanks to the kind aklapper for reporting.

Ref T15137
Closes T15619
Rollback 02a4f8b0c8f1279fc0040ad8077942fd8b0d948b

Test Plan:
- visit /calendar/import/ and:
- create/edit an ICS File Import (now works again)
- create/edit an ICS URI Import (still work)
- try looking at an "ICS Import page" as author (URI still visible)
- try looking at an "ICS Import page" without Edit permissions (URI still omitted correctly)

Reviewers: aklapper, O1 Blessed Committers, 20after4

Reviewed By: aklapper, O1 Blessed Committers, 20after4

Subscribers: 20after4, tobiaswiese, Matthew, Cigaryno

Maniphest Tasks: T15619, T15137

Differential Revision: https://we.phorge.it/D25448

+13 -25
-15
src/applications/calendar/editor/PhabricatorCalendarImportEditEngine.php
··· 83 83 $engine = $object->getEngine(); 84 84 $can_trigger = $engine->supportsTriggers($object); 85 85 86 - // calendar URI import 87 - // note that it can contains a secret token 88 - // if we are here you have enough privileges to edit and see the value 89 - $uri_key = PhabricatorCalendarImportICSURITransaction::PARAMKEY_URI; 90 - $uri = $object->getParameter($uri_key); 91 - 92 86 $fields = array( 93 87 id(new PhabricatorTextEditField()) 94 88 ->setKey('name') ··· 100 94 ->setConduitTypeDescription(pht('New import name.')) 101 95 ->setPlaceholder($object->getDisplayName()) 102 96 ->setValue($object->getName()), 103 - id(new PhabricatorTextEditField()) 104 - ->setKey('uri') 105 - ->setLabel(pht('URI')) 106 - ->setDescription(pht('URI to import.')) 107 - ->setTransactionType( 108 - PhabricatorCalendarImportICSURITransaction::TRANSACTIONTYPE) 109 - ->setConduitDescription(pht('URI to import.')) 110 - ->setConduitTypeDescription(pht('New URI.')) 111 - ->setValue($uri), 112 97 id(new PhabricatorBoolEditField()) 113 98 ->setKey('disabled') 114 99 ->setOptions(pht('Active'), pht('Disabled'))
+13 -10
src/applications/calendar/import/PhabricatorCalendarICSURIImportEngine.php
··· 58 58 PhabricatorCalendarImport $import) { 59 59 $fields = array(); 60 60 61 - if ($engine->getIsCreate()) { 62 - $fields[] = id(new PhabricatorTextEditField()) 63 - ->setKey('uri') 64 - ->setLabel(pht('URI')) 65 - ->setDescription(pht('URI to import.')) 66 - ->setTransactionType( 67 - PhabricatorCalendarImportICSURITransaction::TRANSACTIONTYPE) 68 - ->setConduitDescription(pht('URI to import.')) 69 - ->setConduitTypeDescription(pht('New URI.')); 70 - } 61 + // If you are here, you already have the "can edit" capability. 62 + // So you are supposed to be able to edit again your Calendar import URI. 63 + $uri_key = PhabricatorCalendarImportICSURITransaction::PARAMKEY_URI; 64 + $uri = $import->getParameter($uri_key); 65 + $fields[] = id(new PhabricatorTextEditField()) 66 + ->setKey('uri') 67 + ->setLabel(pht('URI')) 68 + ->setDescription(pht('URI to import.')) 69 + ->setTransactionType( 70 + PhabricatorCalendarImportICSURITransaction::TRANSACTIONTYPE) 71 + ->setConduitDescription(pht('URI to import.')) 72 + ->setConduitTypeDescription(pht('New URI.')) 73 + ->setValue($uri); 71 74 72 75 return $fields; 73 76 }