Browse Source

Fix draft listing

pull/674/head
danpros 1 year ago
parent
commit
c6e2aaa209
2 changed files with 4 additions and 6 deletions
  1. +2
    -4
      system/admin/admin.php
  2. +2
    -2
      system/htmly.php

+ 2
- 4
system/admin/admin.php View File

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


+ 2
- 2
system/htmly.php View File

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


Loading…
Cancel
Save