diff --git a/lib/WeBWorK/ContentGenerator/Options.pm b/lib/WeBWorK/ContentGenerator/Options.pm index 1e57973ca4..8bd6ff8bac 100644 --- a/lib/WeBWorK/ContentGenerator/Options.pm +++ b/lib/WeBWorK/ContentGenerator/Options.pm @@ -62,7 +62,10 @@ sub initialize ($c) { eval { $db->addPassword($effectiveUserPassword) }; $password = $password // $effectiveUserPassword; if ($@) { - $c->addbadmessage($c->maketext("Couldn't change [_1]'s password: [_2]", $e_user_name, $@)); + $c->log->error("Error changing ${e_user_name}'s password: $@"); + $c->addbadmessage($c->maketext( + "[_1]'s password was not changed due to an internal error.", $e_user_name + )); } else { $c->addgoodmessage($c->maketext("[_1]'s password has been changed.", $e_user_name)); } @@ -71,7 +74,10 @@ sub initialize ($c) { eval { $db->putPassword($effectiveUserPassword) }; $password = $password // $effectiveUserPassword; if ($@) { - $c->addbadmessage($c->maketext("Couldn't change [_1]'s password: [_2]", $e_user_name, $@)); + $c->log->error("Error changing ${e_user_name}'s password: $@"); + $c->addbadmessage($c->maketext( + "[_1]'s password was not changed due to an internal error.", $e_user_name + )); } else { $c->addgoodmessage($c->maketext("[_1]'s password has been changed.", $e_user_name)); } @@ -106,8 +112,11 @@ sub initialize ($c) { eval { $db->putUser($c->{effectiveUser}) }; if ($@) { $c->{effectiveUser}->email_address($oldA); - $c->addbadmessage($c->maketext("Couldn't change your email address: [_1]", $@)); + $c->log->error("Unable to save new email address for $userID: $@"); + $c->addbadmessage($c->maketext('Your email address has not been changed due to an internal error.')); } else { + $c->param('currAddress', $c->param('newAddress')); + $c->param('newAddress', undef); $c->addgoodmessage($c->maketext('Your email address has been changed.')); } } @@ -127,7 +136,8 @@ sub initialize ($c) { eval { $db->putUser($c->{effectiveUser}) }; if ($@) { - $c->addbadmessage($c->maketext("Couldn't save your display options: [_1]", $@)); + $c->log->error("Unable to save display options for $userID: $@"); + $c->addbadmessage($c->maketext('Your display options were not saved due to an internal error.')); } else { $c->addgoodmessage($c->maketext('Your display options have been saved.')); } diff --git a/lib/WeBWorK/Utils/Routes.pm b/lib/WeBWorK/Utils/Routes.pm index 4e9c630bc5..3197229372 100644 --- a/lib/WeBWorK/Utils/Routes.pm +++ b/lib/WeBWorK/Utils/Routes.pm @@ -573,13 +573,14 @@ sub setup_content_generator_routes_recursive { my $action = $routeParameters{$child}{action} // 'go'; if ($routeParameters{$child}{children}) { - my $child_route = $route->under($routeParameters{$child}{path})->name($child); + my $child_route = $route->under($routeParameters{$child}{path}, [ problemID => qr/\d+/ ])->name($child); $child_route->any('/')->to("$routeParameters{$child}{module}#$action")->name($child); for (@{ $routeParameters{$child}{children} }) { setup_content_generator_routes_recursive($child_route, $_); } } else { - $route->any($routeParameters{$child}{path})->to("$routeParameters{$child}{module}#$action")->name($child); + $route->any($routeParameters{$child}{path}, [ problemID => qr/\d+/ ]) + ->to("$routeParameters{$child}{module}#$action")->name($child); } return; diff --git a/templates/ContentGenerator/GatewayQuiz.html.ep b/templates/ContentGenerator/GatewayQuiz.html.ep index a38e6f3172..eb1cee7fd4 100644 --- a/templates/ContentGenerator/GatewayQuiz.html.ep +++ b/templates/ContentGenerator/GatewayQuiz.html.ep @@ -74,7 +74,7 @@ $setID, $effectiveUserID, $c->{invalidVersionCreation} ? " (acted as by $userID)" : '' ) =%> -
<%== $c->{invalidSet} %>
+
<%= $c->{invalidSet} %>
% if ($c->{invalidVersionCreation} && $c->{invalidVersionCreation} == 1) {

<%= link_to 'Create new set version.' => $c->systemLink( diff --git a/templates/ContentGenerator/ProblemSet.html.ep b/templates/ContentGenerator/ProblemSet.html.ep index e9e10d9205..88aa48640d 100644 --- a/templates/ContentGenerator/ProblemSet.html.ep +++ b/templates/ContentGenerator/ProblemSet.html.ep @@ -13,7 +13,7 @@ stash('setID'), param('effectiveUser') ) =%>

-

<%== $c->{invalidSet} %>

+

<%= $c->{invalidSet} %>

% last; % }