Fix draft listing

This commit is contained in:
danpros 2024-01-01 19:49:11 +07:00
commit c6e2aaa209
2 changed files with 4 additions and 6 deletions

View file

@ -1265,7 +1265,7 @@ function find_draft_page($static = null)
}
// Return draft static subpage.
function find_draft_subpage($static = null, $sub_static = null)
function find_draft_subpage($sub_static = null)
{
$posts = get_draft_subpages();
@ -1278,9 +1278,7 @@ function find_draft_subpage($static = null, $sub_static = null)
$post = new stdClass;
if (is_null($static)) {
$static = str_replace('content/static/', '', dirname($v['dirname']));
}
// The static page URL
$url= $v['filename'];

View file

@ -3239,7 +3239,7 @@ get('/:static/:sub/edit', function ($static, $sub) {
$page = find_subpage($static, $sub);
if (!$page) {
$page = find_draft_subpage($static, $sub);
$page = find_draft_subpage($sub);
if (!$page) {
not_found();
} else {
@ -3341,7 +3341,7 @@ get('/:static/:sub/delete', function ($static, $sub) {
$page = find_subpage($static, $sub);
if (!$page) {
$page = find_draft_subpage($static, $sub);
$page = find_draft_subpage($sub);
if (!$page) {
not_found();
} else {