Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F18513145
D8061.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D8061.diff
View Options
Index: src/applications/phriction/controller/PhrictionDocumentController.php
===================================================================
--- src/applications/phriction/controller/PhrictionDocumentController.php
+++ src/applications/phriction/controller/PhrictionDocumentController.php
@@ -325,25 +325,44 @@
$limit = 250;
$d_child = PhabricatorSlug::getDepth($slug) + 1;
- $d_total = PhabricatorSlug::getDepth($slug) + $depth;
// Select children and grandchildren.
- $children = queryfx_all(
- $conn,
- 'SELECT d.slug, d.depth, c.title FROM %T d JOIN %T c
- ON d.contentID = c.id
- WHERE d.slug LIKE %> AND d.depth IN (%Ld)
- AND d.status IN (%Ld)
- ORDER BY d.depth, c.title LIMIT %d',
- $document_dao->getTableName(),
- $content_dao->getTableName(),
- ($slug == '/' ? '' : $slug),
- range($d_child, $d_total),
- array(
- PhrictionDocumentStatus::STATUS_EXISTS,
- PhrictionDocumentStatus::STATUS_STUB,
- ),
- $limit);
+ if ($depth == -1) {
+ $children = queryfx_all(
+ $conn,
+ 'SELECT d.slug, d.depth, c.title FROM %T d JOIN %T c
+ ON d.contentID = c.id
+ WHERE d.slug LIKE %> AND d.depth >= %d
+ AND d.status IN (%Ld)
+ ORDER BY d.depth, c.title LIMIT %d',
+ $document_dao->getTableName(),
+ $content_dao->getTableName(),
+ ($slug == '/' ? '' : $slug),
+ $d_child,
+ array(
+ PhrictionDocumentStatus::STATUS_EXISTS,
+ PhrictionDocumentStatus::STATUS_STUB,
+ ),
+ $limit);
+ } else {
+ $d_total = PhabricatorSlug::getDepth($slug) + $depth;
+ $children = queryfx_all(
+ $conn,
+ 'SELECT d.slug, d.depth, c.title FROM %T d JOIN %T c
+ ON d.contentID = c.id
+ WHERE d.slug LIKE %> AND d.depth IN (%Ld)
+ AND d.status IN (%Ld)
+ ORDER BY d.depth, c.title LIMIT %d',
+ $document_dao->getTableName(),
+ $content_dao->getTableName(),
+ ($slug == '/' ? '' : $slug),
+ range($d_child, $d_total),
+ array(
+ PhrictionDocumentStatus::STATUS_EXISTS,
+ PhrictionDocumentStatus::STATUS_STUB,
+ ),
+ $limit);
+ }
if (!$children) {
return;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sep 6 2025, 9:12 AM (11 w, 14 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
9088550
Default Alt Text
D8061.diff (2 KB)
Attached To
Mode
D8061: Show configurable level in the Document Hierarchy in Phriction.
Attached
Detach File
Event Timeline
Log In to Comment