When using a translated intranet, tags moderation using checkboxes and a
submit button doesn't work. You get a message "Unknown Operation on x
Term(s)" (translated of course).
This patch corrects by using name="op-[operation]" instead of name="op"
in each submit input.
Test plan :
- Create a new tag on a record
- Go to tags moderation in Tools
=> You should see your tag in pending terms
- Click on checkbox
- Click on Approve or Reject submit button at the bottom of the table
=> Without patch the tag is still pending
=> With patch operation is well performed, tag is not pending
- Test "Check lists" form
- Test Approve and Reject buttons from "Actions" column
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Passes all tests and QA script.
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
</table>
[% END %]
[% IF ( tagloop ) %]<fieldset class="action">
- <input type="submit" value="Approve" id="approve_button" name="op" />
- <input type="submit" value="Reject" id="reject_button" name="op" />
+ <input type="submit" value="Approve" id="approve_button" name="op-approve" />
+ <input type="submit" value="Reject" id="reject_button" name="op-reject" />
</fieldset>[% END %]
</form>
</div>
<div class="description">Enter a word or phrase to check against approved/rejected lists: </div>
<form method="post" action="/cgi-bin/koha/tags/review.pl">
<input type="text" size="14" name="test" id="test" />
- <fieldset class="action"><input type="submit" value="Test" id="test_button" name="op" /></fieldset>
+ <fieldset class="action"><input type="submit" value="Test" id="test_button" name="op-test" /></fieldset>
<div id="verdict">
[% IF ( test_term ) %]
[% IF ( verdict_ok ) %]
});
my ($op, @errors, @tags);
-$op = lc($input->param('op')) || 'none';
+
+foreach (qw( approve reject test )) {
+ $op = $_ if ( $input->param("op-$_") );
+}
+$op ||= 'none';
+
@tags = $input->param('tags');
$borrowernumber == 0 and push @errors, {op_zero=>1};