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

--- Comment #7 from Emmi Takkinen <[email protected]> ---
(In reply to Marcel de Rooy from comment #6)
> Couldnt finish here, but a few questions:
> 
> This if seems unneeded :)
>         if ( $op eq 'add_form' ) {
>             C4::Form::MessagingPreferences::restore_form_values( $input,
> $template );
>         } else {
>             C4::Form::MessagingPreferences::restore_form_values( $input,
> $template );
>         }
Hmm, I probably assumed that if an error occurs during creating a new patron,
op is still add_form. But that doesn't seem to be the case, it changes as
cud-insert. So this is indeed unneeded. 

> +        my @transport_types = $input->multi_param($message_attribute_id);
> +        foreach my $transport_type (@transport_types) {
> +            $option->{ 'transports_' . $transport_type } = 1;
> +        }
> What is done here exactly? Not all values are transport types, right ?
While looping through all the message preferences it first finds the transport
type which is selected in the form for the message preferences (by using its
id). These are send from the form to back-end as key-value pairs like this: 4:
'email'. Or if sms messages are enabled 4: ['sms', 'email']. Then it loops
through the found transport types. It takes the preference ($option variable),
finds 'transports_[transport_type]' key and changes its value as 1.    

> A new routine in a module requires a unit test. Could you add one?
Will do. This might take a while though since we don't have any tests for this
module yet.

-- 
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