[Bug 6790] New: C4::Serials::getroutinglist returns unnecessary variable
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=6790 Bug #: 6790 Summary: C4::Serials::getroutinglist returns unnecessary variable Classification: Unclassified Change sponsored?: --- Product: Koha Version: master Platform: All OS/Version: All Status: NEW Severity: enhancement Priority: P5 Component: Serials AssignedTo: colin.campbell@ptfs-europe.com ReportedBy: colin.campbell@ptfs-europe.com QAContact: koha-bugs@lists.koha-community.org The subroutine getroutinglist returns a "count" variable along with the array. Not only is this unnecessary but it causes the routine to execute an unnecessary loop and results in some ugly, unidiomatic code in the calling cgi. Refactor count away. -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA Contact for the bug.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=6790 --- Comment #1 from Colin Campbell <colin.campbell@ptfs-europe.com> 2011-08-26 15:57:21 UTC --- Created attachment 5161 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=5161 Proposed Patch -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA Contact for the bug.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=6790 Colin Campbell <colin.campbell@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Priority|P5 |PATCH-Sent Status|NEW |ASSIGNED Patch Status|--- |Needs Signoff -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA Contact for the bug.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=6790 --- Comment #2 from Frère Sébastien Marie <semarie-koha@latrappe.fr> 2011-08-27 10:03:19 UTC --- Your patch use an unsupported form of template style, that may cause problem in translation processing. In 'serials/routing.tt', you wrote: <option[%- IF r == member.ranking -%] selected="selected"[% END %] value="[% r %]">[% r %]</option> The "IF" directive is *in* tag 'option': this kind of construction is unsupported. (but not problem when directive are in attribute, like 'r' with the 'value' attribute). Your should use instead of: [% IF r == member.ranking %] <option selected="selected" value="[% r %]">[% r %]</option> [% ELSE %] <option value="[% r %]">[% r %]</option> [% END %] For more detail about this problem, please see bug 6458. -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA Contact for the bug.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=6790 Colin Campbell <colin.campbell@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #5161|0 |1 is obsolete| | --- Comment #3 from Colin Campbell <colin.campbell@ptfs-europe.com> 2011-08-30 13:44:53 UTC --- Created attachment 5217 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=5217 Modified Patch Modified patch to avoid the bug reported in TTparser.pm -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA Contact for the bug.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=6790 Paul Poulain <paul.poulain@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version|master |Rel_3_8 --- Comment #4 from Paul Poulain <paul.poulain@biblibre.com> 2011-10-24 11:38:16 UTC --- Updating Version : This ENH will be for Koha 3.8 -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA Contact for the bug.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=6790 Paul Poulain <paul.poulain@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version|Rel_3_8 |master --- Comment #5 from Paul Poulain <paul.poulain@biblibre.com> 2011-10-25 15:05:51 UTC --- Bug versionned for master. entries will be made against rel_3_8 once the patch has been applied (see thread about that on koha-devel yesterday) -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA Contact for the bug.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=6790 Chris Cormack <chris@bigballofwax.co.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #5217|0 |1 is obsolete| | --- Comment #6 from Chris Cormack <chris@bigballofwax.co.nz> 2011-12-31 07:27:48 UTC --- Created attachment 6990 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=6990 Bug 6790: Remove unnecessary variable from getroutinglist return getroutinglist returns a count variable to indicate how many elements are in the array. This is almost always a serious code smell. (We are programming in a list manipulating language) The routine was executing am unnecessary loop just to maintain that var. Removed the variable from the routine and perldoc refactored calls of the routine removed the c-style loops for more idiomatic and maintainable for loops renamed some opaquely named variables removed a call to the routine where nothing was done with the data moved some html out of the calling script and into the template Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz> -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA Contact for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=6790 Chris Cormack <chris@bigballofwax.co.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |chris@bigballofwax.co.nz Patch Status|Needs Signoff |Signed Off -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA Contact for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=6790 Ian Walls <koha.sekjal@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Priority|PATCH-Sent (DO NOT USE) |P5 - low Status|Signed Off |Passed QA CC| |koha.sekjal@gmail.com --- Comment #7 from Ian Walls <koha.sekjal@gmail.com> 2012-01-21 16:22:51 UTC --- Removes for loops in favour of foreach. Does some minor cleanup to quotes and spacing to clean various coding style violations. Looks solid, marking as Passed QA -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA Contact for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=6790 Paul Poulain <paul.poulain@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to Master CC| |paul.poulain@biblibre.com Version|master |rel_3_8 --- Comment #8 from Paul Poulain <paul.poulain@biblibre.com> 2012-01-23 17:06:01 UTC --- QA comment: t/db_dependent/lib/KohaTest/Serials.pm does not work after this patch, but it was not working before the patch, so it's OK. patch pushed -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA Contact for the bug. You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org