From 4fccf94a32fe8ac2e4ffdcd219652b66948a3bc0 Mon Sep 17 00:00:00 2001 From: Glenn Rice Date: Mon, 9 Sep 2024 05:48:59 -0500 Subject: [PATCH] Preserve check and radio state when performing a submit action in the File Manager. This was an error in the conversion from mod_perl2 to Mojolicious. The hidden form fields set in the `HiddenFlags` method of `WeBWorK::ContentGenerator::Instructor::FileManager` need to set the value of each field to the paramater (done via the `getFlag` method). That is how it was before the conversion to Mojolicious, but I made a mistake and dropped it in the conversion. This fixes issue #2567. --- lib/WeBWorK/ContentGenerator/Instructor/FileManager.pm | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/WeBWorK/ContentGenerator/Instructor/FileManager.pm b/lib/WeBWorK/ContentGenerator/Instructor/FileManager.pm index eab79360df..323743053f 100644 --- a/lib/WeBWorK/ContentGenerator/Instructor/FileManager.pm +++ b/lib/WeBWorK/ContentGenerator/Instructor/FileManager.pm @@ -135,11 +135,11 @@ sub Init ($c) { sub HiddenFlags ($c) { return $c->c( - $c->hidden_field(dates => ''), - $c->hidden_field(overwrite => ''), - $c->hidden_field(unpack => ''), - $c->hidden_field(autodelete => ''), - $c->hidden_field(autodelete => 'Automatic'), + $c->hidden_field(dates => $c->getFlag('dates')), + $c->hidden_field(format => $c->getFlag('format', 'Automatic')), + $c->hidden_field(overwrite => $c->getFlag('overwrite')), + $c->hidden_field(unpack => $c->getFlag('unpack')), + $c->hidden_field(autodelete => $c->getFlag('autodelete')), )->join(''); }