summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
3d8f462)
(Apparently) unlike HTML::Template::Pro, Template Toolkit doesn't like
template variables that are entirely numeric -- in conditionals, it
consider them integers, most of which are Perl true.
This patch changes this by setting the error variable to the error
value.
To test:
[1] Run the test plan from the previous patch. In each
case, verify that the error message is specifically applicable
to the test. For example, if you try uplaoading a patron image
that is larger than 500KB, the error message displayed should
specifically say so.
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Thank you Galen for catching this. Error messages showing up
now are much more specific and according to the error codes given.
I testd uploading a file larger then 500KB and triggered several
error messages giving the error code in the URL:
/cgi-bin/koha/patroncards/manage.pl?card_element=profile&error=201
All tests and QA script pass.
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
<div class="dialog alert">
<p>
<strong>WARNING:</strong>
<div class="dialog alert">
<p>
<strong>WARNING:</strong>
+ [% IF ( error == 101 ) %]
The database returned an error while [% IF ( card_element ) %]saving [% card_element %] [% element_id %][% ELSE %]attempting a save operation[% END %]. Please have your system administrator check the error log for details.
The database returned an error while [% IF ( card_element ) %]saving [% card_element %] [% element_id %][% ELSE %]attempting a save operation[% END %]. Please have your system administrator check the error log for details.
+ [% ELSIF ( error == 102 ) %]
The database returned an error while [% IF ( card_element ) %]deleting [% card_element %] [% element_id %][% ELSIF ( image_ids ) %][% image_ids %][% ELSE %]attempting a delete operation[% END %]. Please have your system administrator check the error log for details.
The database returned an error while [% IF ( card_element ) %]deleting [% card_element %] [% element_id %][% ELSIF ( image_ids ) %][% image_ids %][% ELSE %]attempting a delete operation[% END %]. Please have your system administrator check the error log for details.
+ [% ELSIF ( error == 201 ) %]
An unsupported operation was attempted[% IF ( element_id ) %] on [% card_element %] [% element_id %][% END %]. Please have your system administrator check the error log for details.
An unsupported operation was attempted[% IF ( element_id ) %] on [% card_element %] [% element_id %][% END %]. Please have your system administrator check the error log for details.
+ [% ELSIF ( error == 202 ) %]
An error has occurred. Please ask your system administrator to check the error log for more details.
An error has occurred. Please ask your system administrator to check the error log for more details.
+ [% ELSIF ( error == 203 ) %]
A non-existent or invalid library code was supplied. Please <a href="/cgi-bin/koha/circ/selectbranchprinter.pl">verify</a> that you have a library selected.
A non-existent or invalid library code was supplied. Please <a href="/cgi-bin/koha/circ/selectbranchprinter.pl">verify</a> that you have a library selected.
+ [% ELSIF ( error == 301 ) %]
An error has occurred while attempting to upload the image file. Please ask you system administrator to check the error log for more details.
An error has occurred while attempting to upload the image file. Please ask you system administrator to check the error log for more details.
+ [% ELSIF ( error == 302 ) %]
Image exceeds 500KB. Please resize and import again.
Image exceeds 500KB. Please resize and import again.
+ [% ELSIF ( error == 303 ) %]
The database image quota currently only allows a maximum of [% image_limit %] images to be stored at any one time. Please delete one or more images to free up quota space.
The database image quota currently only allows a maximum of [% image_limit %] images to be stored at any one time. Please delete one or more images to free up quota space.
+ [% ELSIF ( error == 401 ) %]
An error has occurred and the item(s) was not added to batch [% batch_id %]. Please have your system administrator check the error log for details.
An error has occurred and the item(s) was not added to batch [% batch_id %]. Please have your system administrator check the error log for details.
+ [% ELSIF ( error == 402 ) %]
The item(s) was not added because the library is not set. Please set your library before adding items to a batch.
The item(s) was not added because the library is not set. Please set your library before adding items to a batch.
+ [% ELSIF ( error == 403 ) %]
An error has occurred and the item(s) was not removed from batch [% batch_id %]. Please have your system administrator check the error log for details.
An error has occurred and the item(s) was not removed from batch [% batch_id %]. Please have your system administrator check the error log for details.
+ [% ELSIF ( error == 404 ) %]
An error has occurred and batch [% batch_id %] was not deleted. Please have your system administrator check the error log for details.
An error has occurred and batch [% batch_id %] was not deleted. Please have your system administrator check the error log for details.
+ [% ELSIF ( error == 405 ) %]
An error has occurred and batch [% batch_id %] not fully de-duplicated.
[% ELSE %]
[% END %]
An error has occurred and batch [% batch_id %] not fully de-duplicated.
[% ELSE %]
[% END %]
table_loop => $table,
duplicate_message => $duplicate_message,
duplicate_count => $duplicate_count,
table_loop => $table,
duplicate_message => $duplicate_message,
duplicate_count => $duplicate_count,
- error => ($errstr ? 1 : 0),
- $errstr => 1,
);
output_html_with_http_headers $cgi, $cookie, $template->output;
);
output_html_with_http_headers $cgi, $cookie, $template->output;
SOURCE_FILE => $source_file,
IMAGE_NAME => $image_name,
TABLE => $table,
SOURCE_FILE => $source_file,
IMAGE_NAME => $image_name,
TABLE => $table,
- error => 1,
- $errstr => 1,
SOURCE_FILE => $source_file,
IMAGE_NAME => $image_name,
TABLE => $table,
SOURCE_FILE => $source_file,
IMAGE_NAME => $image_name,
TABLE => $table,
- error => 1,
- $errstr => 1,
SOURCE_FILE => $source_file,
IMAGE_NAME => $image_name,
TABLE => $table,
SOURCE_FILE => $source_file,
IMAGE_NAME => $image_name,
TABLE => $table,
- error => 1,
- $errstr => 1,
image_limit => $image_limit,
);
}
image_limit => $image_limit,
);
}
DELETE_SUCCESSFULL => 0,
IMAGE_IDS => join(', ', @image_ids),
TABLE => $table,
DELETE_SUCCESSFULL => 0,
IMAGE_IDS => join(', ', @image_ids),
TABLE => $table,
- error => 1,
- $errstr => 1,
image_ids => join(',',@image_ids),
);
}
image_ids => join(',',@image_ids),
);
}
SOURCE_FILE => $source_file,
IMAGE_NAME => $image_name,
TABLE => $table,
SOURCE_FILE => $source_file,
IMAGE_NAME => $image_name,
TABLE => $table,
- error => 1,
- $errstr => 1,
$template->param(print => 1) if ($card_element eq 'batch');
$template->param(
$template->param(print => 1) if ($card_element eq 'batch');
$template->param(
- error => ($errstr ? 1 : 0),
- $errstr => 1,
);
$template->param(
op => $op,
);
$template->param(
op => $op,