https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34776

--- Comment #18 from Emmi Takkinen <[email protected]> ---
(In reply to Marcel de Rooy from comment #17)
> [1]
> Instead of 
> +    my $set_form_values_vars = $vars;
> 
> we should do something like:
> +    my $set_form_values_vars = { %$vars };
> +    $vars = {};
> 
> Otherwise we are just comparing the same.
> 
> [2]
> If you change [1], you will get an error on digest. There is something
> wrong. Maybe related to [3].
> 
> [3]
> The test does
> +    C4::Members::Messaging::SetMessagingPreference(
> +        {
> +            borrowernumber          => $patron->id,
> So changing prefs for a specific borrower.
> 
> The POD of restore_form_values says:
>     C4::Form::MessagingPreferences::restore_form_values({ borrowernumber =>
> 51 }, $template, $input);
> Restores patron message preferences if error occurs while creating a patron.
> 
> But the code does not look at a borrower:
>     my ( $input, $template ) = @_;
>     my $messaging_options = C4::Members::Messaging::GetMessagingOptions();
> We do not even pass a patron.

POD is just wrong, restore_form_values receives only $input and $template
params. In tests I tried to replicate the situation where we add patron with
new message preferences and then we fetch them with set_form_values, hence use
of SetMessagingPreference. But... now I have no idea how I thought this should
work :D Back to the drawing board.

-- 
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[email protected]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to