#928: Bibrecord: avoid calling validate_record_field_positions_global()
---------------------+-----------------------
Reporter:  jmartinm  |      Owner:
    Type:  defect    |     Status:  new
Priority:  major     |  Component:  BibRecord
 Version:            |   Keywords:
---------------------+-----------------------
 The function validate_record_field_positions_global() in bibrecord.py is
 only used in two places, and both are like:
 {{{
 error = validate_record_field_positions_global(rec)
     if error:
         # FIXME one should write a message here.
         pass
 }}}

 This function loops through all record tags and fields thus adding an
 overhead when adding or deleting fields in the bibrecord structure.

 Apart from that, the function does not seem to be correct. It does check
 the order of the global positions correctly but not the duplication of
 global positions.

 It uses
 {{{
 all_fields = []
 }}}
 and never updates that list so the check
 {{{
 if field[4] in all_fields:
 }}}

 does not seem to make sense.

 Until the function is given a proper use we could comment out the calls to
 speed up adding and deleting fields to the bibrecord structure.

-- 
Ticket URL: <http://invenio-software.org/ticket/928>
Invenio <http://invenio-software.org>

Reply via email to