Bug 12409: Fix fields order on exporting to bibtex
authorJonathan Druart <jonathan.druart@biblibre.com>
Thu, 12 Jun 2014 09:06:58 +0000 (11:06 +0200)
committerTomas Cohen Arazi <tomascohen@gmail.com>
Mon, 7 Jul 2014 13:13:02 +0000 (10:13 -0300)
commitb140b8cc0841494ac03fcb3c5faf83e1678d2bd2
tree5783c100309507b0e9f2d5b97c0d495fdde8a97c
parent16250f76d2bbdbee0cb8d6115a80c182e84e94e4
Bug 12409: Fix fields order on exporting to bibtex

The C4::Record::marc2bibtex subroutine supposes hashref keys are sorted
which is wrong with perl 5.18

Note that the t/db_dependent/Record.t fails without this patch.

Test plan (for perl >= 5.18 only):
1/ prove t/db_dependent/Record.t should return green
2/ Try to export a record to bibtex and verify the order is correct
(should be author, title, year, published, etc.).

http://bugs.koha-community.org/show_bug.cgi?id=12409

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Wrong Bug number on heading.
Work as described, test pass, no koha-qa errors.

The problem is to think that a hash returns
keys in a particular order, that's not true
and no matter which perl version.

Code as was left is... misleading.
Comments talks about a hash, which is no more.
On array asignment "a => b" is equivalent to "a, b",
but the former is usually used on hashes, so a
replacement of '=>' by ',' could clarify what are we storing.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Fixing the comments in a follow-up patch.
Tests pass now without problems and records export ok.

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
C4/Record.pm