Refactor auto-export settings: Add hidden input for checkbox values to ensure proper boolean handling in form submission.

This commit is contained in:
interlope committed 2026-06-08 19:55:27 +02:00
1 parent 8ac291c2af
commit 5cd322446a
1 file changed
+2 -6
+2 -6
View File
@@ -56,10 +56,10 @@ class pluginBluditGithub extends Plugin
$html .= '<div style="margin-top:1.5em;padding-top:1em;border-top:1px solid #eee">';
$html .= '<label>Auto-export settings</label>';
$html .= '<div>';
$html .= '<label><input name="exportDraftsAuto" type="checkbox" value="1" ' . $exportDraftsAuto . '> Auto-export draft articles on save</label>';
$html .= '<label><input type="hidden" name="exportDraftsAuto" value="0"><input name="exportDraftsAuto" type="checkbox" value="1" ' . $exportDraftsAuto . '> Auto-export draft articles on save</label>';
$html .= '</div>';
$html .= '<div>';
$html .= '<label><input name="exportPublishedAuto" type="checkbox" value="1" ' . $exportPublishedAuto . '> Auto-export published articles on save</label>';
$html .= '<label><input type="hidden" name="exportPublishedAuto" value="0"><input name="exportPublishedAuto" type="checkbox" value="1" ' . $exportPublishedAuto . '> Auto-export published articles on save</label>';
$html .= '</div>';
$html .= '</div>';
@@ -82,10 +82,6 @@ class pluginBluditGithub extends Plugin
{
parent::post();
$this->db['exportDraftsAuto'] = (isset($_POST['exportDraftsAuto']) && $_POST['exportDraftsAuto']) ? true : false;
$this->db['exportPublishedAuto'] = (isset($_POST['exportPublishedAuto']) && $_POST['exportPublishedAuto']) ? true : false;
$this->db->save();
if (!empty($_POST['bulkExportAll'])) {
$this->bulkExport(true);
} elseif (!empty($_POST['bulkExportPublished'])) {