Changeset View
Changeset View
Standalone View
Standalone View
src/applications/project/state/PhabricatorWorkboardViewState.php
Show All 35 Lines | public function readFromRequest(AphrontRequest $request) { | ||||
// In particular, the "queryKey" URI parameter is used by | // In particular, the "queryKey" URI parameter is used by | ||||
// "buildSavedQueryFromRequest()" when we are building custom board filters | // "buildSavedQueryFromRequest()" when we are building custom board filters | ||||
// by invoking SearchEngine code. | // by invoking SearchEngine code. | ||||
if ($request->getExists('filter')) { | if ($request->getExists('filter')) { | ||||
$this->requestState['filter'] = $request->getStr('filter'); | $this->requestState['filter'] = $request->getStr('filter'); | ||||
} | } | ||||
if (strlen($request->getURIData('queryKey'))) { | if (phutil_nonempty_string($request->getURIData('queryKey'))) { | ||||
valerio.bozzolan: ✅ I tested this locally with `phlog()` and `$request->getURIData('queryKey')` assumes values… | |||||
$this->requestState['filter'] = $request->getURIData('queryKey'); | $this->requestState['filter'] = $request->getURIData('queryKey'); | ||||
} | } | ||||
$this->viewer = $request->getViewer(); | $this->viewer = $request->getViewer(); | ||||
return $this; | return $this; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 111 Lines • ▼ Show 20 Lines | if ($request_order !== null) { | ||||
} | } | ||||
} | } | ||||
return $this->getDefaultOrder(); | return $this->getDefaultOrder(); | ||||
} | } | ||||
public function getQueryKey() { | public function getQueryKey() { | ||||
$request_query = idx($this->requestState, 'filter'); | $request_query = idx($this->requestState, 'filter'); | ||||
if (strlen($request_query)) { | if (phutil_nonempty_string($request_query)) { | ||||
Done Inline Actions✅ I tested this locally with phlog() and $request_query assumes values like "EoH3rp0DnRFW" or other search keys, or null. The phutil_nonempty_string() will report alien types, and that is OK. valerio.bozzolan: ✅ I tested this locally with `phlog()` and `$request_query` assumes values like… | |||||
return $request_query; | return $request_query; | ||||
} | } | ||||
return $this->getDefaultQueryKey(); | return $this->getDefaultQueryKey(); | ||||
} | } | ||||
public function setQueryKey($query_key) { | public function setQueryKey($query_key) { | ||||
$this->requestState['filter'] = $query_key; | $this->requestState['filter'] = $query_key; | ||||
Show All 17 Lines | private function getDefaultOrder() { | ||||
return PhabricatorProjectColumnNaturalOrder::ORDERKEY; | return PhabricatorProjectColumnNaturalOrder::ORDERKEY; | ||||
} | } | ||||
private function getDefaultQueryKey() { | private function getDefaultQueryKey() { | ||||
$project = $this->getProject(); | $project = $this->getProject(); | ||||
$default_query = $project->getDefaultWorkboardFilter(); | $default_query = $project->getDefaultWorkboardFilter(); | ||||
if (strlen($default_query)) { | if (phutil_nonempty_string($default_query)) { | ||||
Done Inline Actions✅ I tested this locally with phlog() and $default_query assumes values like "all" or other strings, or null. The phutil_nonempty_string() will report alien types, and that is OK. valerio.bozzolan: ✅ I tested this locally with `phlog()` and `$default_query` assumes values like `"all"` or… | |||||
return $default_query; | return $default_query; | ||||
} | } | ||||
return 'open'; | return 'open'; | ||||
} | } | ||||
public function getQueryParameters() { | public function getQueryParameters() { | ||||
return $this->requestState; | return $this->requestState; | ||||
▲ Show 20 Lines • Show All 77 Lines • Show Last 20 Lines |
Content licensed under Creative Commons Attribution-ShareAlike 4.0 (CC-BY-SA) unless otherwise noted; code licensed under Apache 2.0 or other open source licenses. · CC BY-SA 4.0 · Apache 2.0
✅ I tested this locally with phlog() and $request->getURIData('queryKey') assumes values like "all" or other strings, or null.
The phutil_nonempty_string() will report alien types, and that is OK.