Bug 14267 - How active is active in additem.tt?
Summary: How active is active in additem.tt?
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Templates (show other bugs)
Version: Main
Hardware: All All
: P5 - low minor (vote)
Assignee: Marcel de Rooy
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-05-25 09:26 UTC by Marcel de Rooy
Modified: 2016-12-05 21:23 UTC (History)
3 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:


Attachments
Bug 14267: How active is active? (2.09 KB, patch)
2015-05-25 09:40 UTC, Marcel de Rooy
Details | Diff | Splinter Review
Bug 14267: How active is active? (2.76 KB, patch)
2015-05-25 17:43 UTC, Mark Tompsett
Details | Diff | Splinter Review
Bug 14267: How active is active? (2.82 KB, patch)
2015-05-26 10:41 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Marcel de Rooy 2015-05-25 09:26:15 UTC
git grep on function active in additem.tt:

koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt:function active(n
koha-tmpl/intranet-tmpl/prog/en/modules/serials/serial-issues-full.tt:active([%
koha-tmpl/intranet-tmpl/prog/en/modules/serials/serial-issues-full.tt:function a
koha-tmpl/intranet-tmpl/prog/en/modules/serials/serial-issues-full.tt:
t/Cache.t:      unless ( $cache->is_cache_active() && defined $cache );
t/Cache.t:          unless ( $cache->is_cache_active() );

active in additem seems to be quite inactive
Comment 1 Marcel de Rooy 2015-05-25 09:40:53 UTC Comment hidden (obsolete)
Comment 2 Mark Tompsett 2015-05-25 17:43:10 UTC Comment hidden (obsolete)
Comment 3 Jonathan Druart 2015-05-26 10:41:34 UTC
Created attachment 39508 [details] [review]
Bug 14267: How active is active?

git grep on function active in additem.tt:
koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt:function active(n
koha-tmpl/intranet-tmpl/prog/en/modules/serials/serial-issues-full.tt:active([%
koha-tmpl/intranet-tmpl/prog/en/modules/serials/serial-issues-full.tt:function a
koha-tmpl/intranet-tmpl/prog/en/modules/serials/serial-issues-full.tt:
t/Cache.t:      unless ( $cache->is_cache_active() && defined $cache );
t/Cache.t:          unless ( $cache->is_cache_active() );
Conclusion: active in additem seems to be quite inactive.

Test plan:
Add, edit or delete items and verify that you did not miss active :)

NOTE: The active function has a loop which is always run.
      Inside that loop 'ong' would always be defined as some number
       concatenated with XX.
      Both sides of the if/else reference document.getElementById(ong),
       but there is only one occurence of XX in the file: the concatenation!
      Similarly, the 'link' logic does not correspond to any of the
       id= or name= strings in the file.
      koha-tmpl/intranet-tmpl/prog/en/modules/admin/marc_subfields_structure.tt
       is the only file with "id=\"link" that matches the logic.
      This is likely a cut-and-paste remnant made useless by datatable upgrades
       and HTML/CSS class changes.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>

Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
Comment 4 Jonathan Druart 2015-05-26 10:42:55 UTC
Yes it's definitely dead code.
It was used to select active tab.
But actually I suspect a c/p at the creation of the template.

Note that this active function is still defined on serials/serial-issues-full.tt but I did not manage to reach this template...
Comment 5 Tomás Cohen Arazi 2015-06-04 14:16:25 UTC
Patch pushed to master.

Thanks Marcel!
Comment 6 Chris Cormack 2015-06-07 08:16:22 UTC
Pushed to 3.20.x will be in 3.20.1