From b9b27b7ed2f54aac15df4d673b68f9f173bc3420 Mon Sep 17 00:00:00 2001 From: "E. S." Date: Sat, 9 Mar 2024 16:27:13 +0000 Subject: [PATCH] admin: fix page editing --- handler/AdminHandler.php | 2 +- htdocs/js/admin/11-write-form.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/handler/AdminHandler.php b/handler/AdminHandler.php index e5b9aab..0ba1918 100644 --- a/handler/AdminHandler.php +++ b/handler/AdminHandler.php @@ -263,7 +263,7 @@ class AdminHandler extends request_handler { $page->edit([ 'title' => $title, 'md' => $text, - 'visible' => (int)$visible, + 'visible' => (bool)$visible, 'short_name' => $short_name, ]); diff --git a/htdocs/js/admin/11-write-form.js b/htdocs/js/admin/11-write-form.js index f5d465a..aaf93f5 100644 --- a/htdocs/js/admin/11-write-form.js +++ b/htdocs/js/admin/11-write-form.js @@ -134,7 +134,7 @@ class AdminWriteEditForm { } // fd.append('lang', this.getCurrentLang()) - if (this.isPost()) + if (this.isPost() || this.isEditing()) fd.append('visible', ge('visible_cb').checked ? 1 : 0) // text-specific fields