Some framework for biblio records have no items field (952 in MARC21, 995 in UNIMARC). Records can not have items for example a serial article. In this case creating a record should not lead to item creation.
Created attachment 122230 [details] [review] Bug 28608: Creating a biblio record must not lead to item creation when framework has no items field Some framework for biblio records have no items field (952 in MARC21, 995 in UNIMARC). Records can not have items for example a serial article. In this case creating a record should not lead to item creation. This patch adds a condition next to items edition permission to have only one save button when framework has no items field. 1) Create a biblio framework without items field (952 in MARC21, 995 in UNIMARC) 2) Create a biblio record with this framework 3) Click on "Save" => Without patch you see items creation page (with no inputs in form) => With patch you see record details page
We may hide other things when framework has no items field. Maybe we will create a method has_items() in Koha::BiblioFramework
Created attachment 122254 [details] [review] Issue #6 - list of bugs applied must be global https://bugs.koha-community.org/show_bug.cgi?id=28608 Signed-off-by: hakam <hakam@inlibro.com>
Created attachment 122255 [details] [review] Bug 28608: Creating a biblio record must not lead to item creation when framework has no items field Some framework for biblio records have no items field (952 in MARC21, 995 in UNIMARC). Records can not have items for example a serial article. In this case creating a record should not lead to item creation. This patch adds a condition next to items edition permission to have only one save button when framework has no items field. 1) Create a biblio framework without items field (952 in MARC21, 995 in UNIMARC) 2) Create a biblio record with this framework 3) Click on "Save" => Without patch you see items creation page (with no inputs in form) => With patch you see record details page Signed-off-by: hakam <hakam@inlibro.com>
Interesting!
Processing files before patches Argument "" isn't numeric in numeric gt (>) at /usr/share/koha/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt line 896. |========================>| 2 / 2 (100.00%) Processing files after patches Argument "" isn't numeric in numeric gt (>) at /usr/share/koha/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt line 896.
(In reply to Marcel de Rooy from comment #6) > Processing files before patches > Argument "" isn't numeric in numeric gt (>) at > /usr/share/koha/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/ > addbiblio.tt line 896. > |========================>| 2 / 2 (100.00%) > Processing files after patches > Argument "" isn't numeric in numeric gt (>) at > /usr/share/koha/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/ > addbiblio.tt line 896. [% IF ( BIG_LOOP.size > 1 ) %] ?
QAing. There might be something wrong here..
=head2 GetMarcFromKohaField ( $field,$subfield ) = GetMarcFromKohaField( $kohafield ); @fields = GetMarcFromKohaField( $kohafield ); $field = GetMarcFromKohaField( $kohafield ); Returns the MARC fields & subfields mapped to $kohafield. Since the Default framework is considered as authoritative for such mappings, the former frameworkcode parameter is obsoleted. In list context all mappings are returned; there can be multiple mappings. Note that in the above example you could miss a second mappings in the first call. In scalar context only the field tag of the first mapping is returned. =cut
+( $itemtag, $itemsubfield ) = GetMarcFromKohaField( "items.itemnumber" ); Your call here does not look at the specific itemnumber field in that framework since kohafields are looked up in the Default framework. This is already the case in a few Koha versions. I know since I was involved in that dev ;) So your framework may not have an itemnumber field, but if the Default has, then you can still add an item. You need to think of a solution in some other way?
Oups indeed. Will have another look on it ;)