Bug 13423 - Unused code in serials-edit.tt and serials-recieve.tt
Summary: Unused code in serials-edit.tt and serials-recieve.tt
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: I18N/L10N (show other bugs)
Version: Main
Hardware: All All
: P5 - low trivial
Assignee: Bernardo Gonzalez Kriegel
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks: 18274
  Show dependency treegraph
 
Reported: 2014-12-09 18:09 UTC by Marc Véron
Modified: 2017-03-15 16:27 UTC (History)
9 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments
Bug 13423: Untranslatable strings in serials-edit.tt and serials-recieve.tt (3.46 KB, patch)
2015-03-07 17:32 UTC, Bernardo Gonzalez Kriegel
Details | Diff | Splinter Review
[Signed-off] Bug 13423: Untranslatable strings in serials-edit.tt and serials-recieve.tt (3.71 KB, patch)
2015-03-10 17:54 UTC, Marc Véron
Details | Diff | Splinter Review
Bug 13423: Untranslatable strings in serials-edit.tt and serials-recieve.tt (2.77 KB, patch)
2015-03-24 18:01 UTC, Bernardo Gonzalez Kriegel
Details | Diff | Splinter Review
Bug 13423: Untranslatable strings in serials-edit.tt and serials-recieve.tt (2.72 KB, patch)
2015-03-24 18:02 UTC, Bernardo Gonzalez Kriegel
Details | Diff | Splinter Review
Bug 13423: Untranslatable strings in serials-edit.tt and serials-recieve.tt (3.53 KB, patch)
2015-04-02 13:14 UTC, Mark Tompsett
Details | Diff | Splinter Review
Bug 13423: Remove unused serials-recieve (28.61 KB, patch)
2015-04-25 12:37 UTC, Bernardo Gonzalez Kriegel
Details | Diff | Splinter Review
Bug 13423: Remove unused JS function in serials-edit.tt (3.57 KB, patch)
2015-04-29 09:04 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 13423: Remove unused serials-recieve (28.66 KB, patch)
2015-04-29 09:04 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 13423: Fix number of tests in Serials.t (729 bytes, patch)
2015-04-29 09:04 UTC, Jonathan Druart
Details | Diff | Splinter Review
[PASSED QA] Bug 13423: Remove unused JS function in serials-edit.tt (3.64 KB, patch)
2015-04-29 21:51 UTC, Katrin Fischer
Details | Diff | Splinter Review
[PASSED QA] Bug 13423: Remove unused serials-recieve (28.73 KB, patch)
2015-04-29 21:51 UTC, Katrin Fischer
Details | Diff | Splinter Review
[PASSED QA] Bug 13423: Fix number of tests in Serials.t (799 bytes, patch)
2015-04-29 21:51 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Marc Véron 2014-12-09 18:09:51 UTC
git grep 'confirm("'

Result:

2 untranslatable stings in:
koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-recieve.tt

2 untranslatable strings in:
koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-edit.tt
Comment 1 paxed 2014-12-10 09:21:09 UTC
Should perhaps also grep for "confirm('", which returns different results...
Comment 2 Marc Véron 2014-12-10 10:37:55 UTC
Hi paxed,

I did, some of the outcome is waiting for Sign-off:
Bug 13400
Bug 13410
Bug 13422

Marc
Comment 3 Bernardo Gonzalez Kriegel 2015-03-07 17:32:55 UTC Comment hidden (obsolete)
Comment 4 Marc Véron 2015-03-10 17:54:28 UTC Comment hidden (obsolete)
Comment 5 Katrin Fischer 2015-03-15 21:22:28 UTC
I have no problem with these fixes, but I wonder how to trigger the messages. I didn't manage to - is this code still in use?
Please check and amend test plan - thx!
Comment 6 Bernardo Gonzalez Kriegel 2015-03-15 22:14:52 UTC
(In reply to Katrin Fischer from comment #5)
> I have no problem with these fixes, but I wonder how to trigger the
> messages. I didn't manage to - is this code still in use?
> Please check and amend test plan - thx!

Hehe :)

I don't put better instructions because I down't know either how to trigger the messages

I'll check!
Comment 7 Bernardo Gonzalez Kriegel 2015-03-24 18:01:09 UTC Comment hidden (obsolete)
Comment 8 Bernardo Gonzalez Kriegel 2015-03-24 18:02:07 UTC Comment hidden (obsolete)
Comment 9 Mark Tompsett 2015-04-02 13:14:10 UTC Comment hidden (obsolete)
Comment 10 Kyle M Hall (khall) 2015-04-03 17:24:02 UTC
The only non-obsoleted patch no long makes the strings in serials-recieve.tt translatable.
Comment 11 Bernardo Gonzalez Kriegel 2015-04-25 12:37:10 UTC Comment hidden (obsolete)
Comment 12 Bernardo Gonzalez Kriegel 2015-04-25 12:38:31 UTC
(In reply to Kyle M Hall from comment #10)
> The only non-obsoleted patch no long makes the strings in serials-recieve.tt
> translatable.

It's also dead code. Followup removes the file.

Second patch needs sign.
Comment 13 Jonathan Druart 2015-04-29 09:04:44 UTC Comment hidden (obsolete)
Comment 14 Jonathan Druart 2015-04-29 09:04:48 UTC Comment hidden (obsolete)
Comment 15 Jonathan Druart 2015-04-29 09:04:52 UTC Comment hidden (obsolete)
Comment 16 Jonathan Druart 2015-04-29 09:05:21 UTC
I took the liberty to edit the commit message of the first patch.
Comment 17 Katrin Fischer 2015-04-29 21:51:45 UTC
Created attachment 38703 [details] [review]
[PASSED QA] Bug 13423: Remove unused JS function in serials-edit.tt

This patch removes unused code:
 * barcode_check() function, with untranslatable strings
 * commented call to this function

To test:
1. Apply the patch
2. Check serials receive, no changes shall be detected

NOTE: I did not run this test plan.

Verification steps
------------------
1. Find out where barcode_check is used.
   $ git grep barcode_check
   -- This is only in serials-edit.tt and serials-receive.tt
2. This patch only affects serials-edit.tt, so
   check who put the <!--onsubmit="return barcode_check()">-->
   $ git blame -L130 koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-edit.tt
   -- note the commit related number.
3. Check out the commit.
   $ git show 77b64098
   -- should show bug 5917, but the patches on bugzilla don't
      have the change nicely, so...
4. Hunt through the pages to find the change.
   -- Note: it is part of a "new file" diff!
5. Since this code hasn't been running since it was added...
6. apply the patch
7. run koha-qa test tools

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 18 Katrin Fischer 2015-04-29 21:51:49 UTC
Created attachment 38704 [details] [review]
[PASSED QA] Bug 13423: Remove unused serials-recieve

This patch removes two files, serials-recieve.pl and serial-recieve.tt
serials-recieve.pl is not called anyware
(it's recieve!)

Also removes the sub removeMissingIssue called only from serials-recieve.pl

git grep serials-recieve.pl .
C4/Serials.pm:called when a missing issue is found from the serials-recieve.pl file
koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-recieve.tt:     <form method="post" name="f" action="serials-recieve.pl" onsubmit="return barcode_check()">
koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-recieve.tt:     <form method="post" name="f2" action="serials-recieve.pl">
serials/serials-recieve.pl:serials-recieve.pl

Just a POD entry and self reference.

After removing of files

git grep removeMissingIssue .
C4/Serials.pm:      &check_routing &updateClaim &removeMissingIssue
C4/Serials.pm:=head2 removeMissingIssue
C4/Serials.pm:removeMissingIssue($subscriptionid)
C4/Serials.pm:sub removeMissingIssue {
t/db_dependent/Serials.t:is(C4::Serials::removeMissingIssue(), undef, 'test removing a missing issue');

Not used anymore

To test:
1) Apply the patch
2) Check serials workflow, no changes must be noted

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 19 Katrin Fischer 2015-04-29 21:51:53 UTC
Created attachment 38705 [details] [review]
[PASSED QA] Bug 13423: Fix number of tests in Serials.t

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 20 Tomás Cohen Arazi (tcohen) 2015-05-14 14:57:37 UTC
Parches aplicados en master.

Gracias Bernardo!
Comment 21 Chris Cormack 2015-05-17 23:16:57 UTC
Pushed to 3.18.x will be in 3.18.7
Comment 22 Mason James 2015-05-29 08:07:07 UTC
Possible selection for 3.16.x