Bug 8218 : Add a maintenance script to sanitize biblio records
authorJonathan Druart <jonathan.druart@biblibre.com>
Fri, 28 Sep 2012 13:23:37 +0000 (15:23 +0200)
committerTomas Cohen Arazi <tomascohen@gmail.com>
Tue, 11 Nov 2014 18:38:36 +0000 (15:38 -0300)
commit299a8a69972a6d4b2a77de9047cb39718d2a5278
treedc96ea26317272dde8b02d5651d40b48419ba7a8
parent84de1f143be9a91682c58e34116d91a24fb465ff
Bug 8218 : Add a maintenance script to sanitize biblio records

This patch adds:
- a new maintenance script batch_sanitize_records
- a new subroutine C4::Charset::SanitizeRecord
- new unit tests for the new subroutine

Test plan:
1/ prove t/db_dependent/Charset.t
2/ Create a record containing "&amp;amp;" (could be follow with as many
'amp;' as you want) in one of its fields and the same for the field
linked to biblioitems.url.
The url should not be sanitized, it may contain "&amp;".
3/ Launch the maintenance script with the -h parameter to see how to use
it.
4/ Launch the script using the different parameters:
 --filename=FILENAME
 --biblionumbers='XXX'
 --auto-search

The auto-search permits to sanitize all records containing "&amp;amp;" in
the marcxml field.

Use the verbose flag for testing.
Without the --confirm flag, nothing is done.

5/ Use the --confirm flag and verify in the biblioitems.marcxml field
that the record has been sanitized.

6/ Try the --reindex flag to reindex records which have been modified.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
C4/Charset.pm
misc/maintenance/batch_sanitize_records.pl [new file with mode: 0755]
t/db_dependent/Charset.t [new file with mode: 0644]