Bug 13465: Correct the field prefix ambiguity
authorJonathan Druart <jonathan.druart@biblibre.com>
Wed, 17 Dec 2014 09:43:34 +0000 (10:43 +0100)
committerTomas Cohen Arazi <tomascohen@gmail.com>
Fri, 19 Dec 2014 17:40:21 +0000 (14:40 -0300)
commit2f266d94be06af73e72a807d9408136278e8fed4
treec019255135437895da0735c3b1fbebbcfb8da39a
parentc63003dd5a73f1276d7e1191bef30822326f2994
Bug 13465: Correct the field prefix ambiguity

This is introduced by Bug 12874.

Without this patch, it's not possible to clear (set to an empty string)
an item field.
This appended for field linked to an AV list but even if it's not.

The regex tried to prefix 'my_field' with 'items.' to have
'items.my_field'. It wanted to take care of the case where the prefix
already exists (Actually only 1: 'items.cn_source').
The regex is changed to: "add the prefix only if the string does not
contain a dot".

Moreover an ambiguity existed on the prefix: in marc_subfield_structure,
the kohafield is prefixed, but not in the key of the hash sent to
ModItemFromMarc.

Test plan:
- edit an item, set a status that is controlled by an authorized value
examples tested: damaged, not for loan
- check the status saved correctly
- edit the item again, reset the status to empty
- check the status saved correctly
- edit the item again, reset fields, edit fields
- check the fields saved correctly

Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
C4/Items.pm