https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36365
Lisette Scheer <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #178178|0 |1 is obsolete| | --- Comment #7 from Lisette Scheer <[email protected]> --- Created attachment 178874 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=178874&action=edit Bug 36365: Add a way for compare_es_to_db.pl to fix problems Worked great and the --help is nice. This patch adds a new option switch `--fix` (or `-f`) to make the script try to fix the problems it found. Bonus: `--help` option switch added. To test: 1. Apply this patch 2. Run: $ ktd --shell k$ perl -MKoha::SearchEngine -MKoha::SearchEngine::Indexer -e 'my $i = Koha::SearchEngine::Indexer->new({index => $Koha::SearchEngine::BIBLIOS_INDEX}); $i->delete_index([1]);' => SUCCESS: Bibliographic record #deleted from ES index 3. Run: k$ koha-mysql kohadev > DELETE FROM biblio WHERE biblionumber=2 OR biblionumber=3; => SUCCESS: Bibliographic records 2 and 3 deleted directly from the database, no reindex triggered by Koha. 4. Run: k$ perl misc/maintenance/compare_es_to_db.pl => SUCCESS: The results from (2) and (3) are explained. [1] 5. Run: k$ perl misc/maintenance/compare_es_to_db.pl --fix => SUCCESS: It says it is gonna fix things 6. Repeat 4 => SUCCESS: The problems we generated are no longer reported! They've been fixed! 7. Sign off :-D [1] Note KTD ships some broken records on purpose so devs need to deal with a not-perfect DB everyday, and catch misses in the code. Signed-off-by: Andrew Fuerste Henry <[email protected]> Signed-off-by: Lisette Scheer <[email protected]> -- You are receiving this mail because: You are watching all bug changes. _______________________________________________ Koha-bugs mailing list [email protected] https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
