Adds a new plugin hook, addbiblio_check_record, to addbiblio.pl. When saving a record, the hook is called with the MARC record as a parameter. If the hook returns anything, the return values are shown to the user, and saving the record is prevented. This can be used to create plugins that eg. check or modify the record.
Created attachment 98429 [details] [review] Add plugin hook addbiblio_check_record Adds a new plugin hook, addbiblio_check_record, to addbiblio.pl. When saving a record, the hook is called with the MARC record as a parameter. If the hook returns anything, the return values are shown to the user, and saving the record is prevented. This can be used to create plugins that eg. check or modify the record. Advanced editor has not been changed.
Created attachment 98447 [details] Plugin to test Bug 24589 This is a Koha plugin used to test Bug 24589 functionality. Test plan: 1) Go to cataloging > New record 2) Edit the record, and save it. 3) Enable plugins, upload this plugin, and enable it. 4) Go to cataloging > New record 5) Edit the record, fill the required fields. Make sure 245$a does not contain "FOOBAR". 6) Try to save the record, you'll get a complaint: "ERROR: 245$a was not FOOBAR. Try saving again." 6) Check field 245$a, it should now contain "FOOBAR" 7) Try saving the record, it should now work normally. 8) Disable this plugin, and repeat 1 & 2
Hi, works Ok, just fix the following QA error: FAIL koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt FAIL filters missing_filter at line 694 ( <li>[% MARC_ERR %]</li>) For example: [% MARC_ERR | html %]
Created attachment 99976 [details] [review] Bug 24589: Add plugin hook addbiblio_check_record Adds a new plugin hook, addbiblio_check_record, to addbiblio.pl. When saving a record, the hook is called with the MARC record as a parameter. If the hook returns anything, the return values are shown to the user, and saving the record is prevented. This can be used to create plugins that eg. check or modify the record. Advanced editor has not been changed.
Bug 20145 removed preference 'UseKohaPlugins', please remove it from your patch.
Bug 20415 removed preference 'UseKohaPlugins', please remove it from your patch.
Ohhh I like the sound of this. This could be an interesting way to add checks for authority linking...
Actually, it might be nicer just to have a plugin hook that is fired when a bib is created, modified, or deleted.
(In reply to David Cook from comment #8) > Actually, it might be nicer just to have a plugin hook that is fired when a > bib is created, modified, or deleted. Oh never mind me. That is Bug 22709. I'll see myself out.
Oh, to bad this hook is only linked to "add" operation, it would be very useful to check a record upon modification as well!