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

Support Calendar Event document type for Current Application global search scope

Summary:
`PhabricatorMainMenuSearchView::getGlobalSearchScopeItems()` checks `if ($application->getApplicationSearchDocumentTypes())` and later sets `'value' => $application_value` (if existing) to only search for document types supported by the Current Application.
This works for most applications (e.g. setting Maniphest as the Current Application and Tasks as Document Type when being on http://phorge.localhost/maniphest/).
It does not work for Calendar when being on http://phorge.localhost/calendar/ - global search results are not restricted to Calendar Events when selecting "Current Application".

Fix that by adding the missing function `PhabricatorCalendarApplication::getApplicationSearchDocumentTypes()`.

Closes T16164

Test Plan:
* Go to http://phorge.localhost/calendar/
* In the upper right corner, select the search scope dropdown and see the default application icon in front of "Current Application"
* Before this patch "Current Application" has a generic icon; after this patch "Current Application" has the Calendar icon
* Select "Current Application", enter a search term, press Enter key
* On the results page, before this patch the "Document Types" field is empty and results come from any applications; after this patch the "Document Types" field is set to "Event" and results only come from the Calendar application which was/is our Current Application per the URI where we started

Reviewers: O1 Blessed Committers, mainframe98

Reviewed By: O1 Blessed Committers, mainframe98

Subscribers: tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Maniphest Tasks: T16164

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

+6
+6
src/applications/calendar/application/PhabricatorCalendarApplication.php
··· 152 152 ); 153 153 } 154 154 155 + public function getApplicationSearchDocumentTypes() { 156 + return array( 157 + PhabricatorCalendarEventPHIDType::TYPECONST, 158 + ); 159 + } 160 + 155 161 }