If the field is an AV field, there should be an option to allow for multiple selection.
Created attachment 157324 [details] [review] Bug 35044: [DONT PUSH] dbic specific
Created attachment 157325 [details] [review] Bug 35044: DB changes + atomicupdate file Add the 'repeatable' column to additional_fields Remove the unique key from additional_field_values as we will now be allowing for repeated instances of the same field_id + record_id
Created attachment 157326 [details] [review] Bug 35044: Admin: New additional fields 'repeatable' field There is now a new 'repeatable' checkbox when configuring (adding or editing) an additional field for a specific table. It is also displayed in a column in the additional fields panel for a given tablename. MARC fields are not allowed to be repeatable.
Created attachment 157327 [details] [review] Bug 35044: Preparation: get_additional_field_values_for_template method New method to be utilized for retrieval of additional fields of any class that implements it. This is to be used when additional_fields are needed to be sent to .tt files for renderering. Both for form entries and read-only 'show' pages. Template files: Updated additional-fields-entry.inc: Now considers entry of repeatable fields. Repeatable text fields will have a "+New" link to allow for adding of a new instance of a repeatable field. Repeatable AV fields will be shown as checkboxes instead of a dropdown Update additional-fields-display.inc When displaying non-editable additional-fields, multiple instances for each field are now considered. Label now only shows if field has a non-null value in it. Option to show value_only Option to set if its to be displayed on a table cell Update histsearch.tt and filter-orders.inc Now calls additional-fields-entry.inc with search_form=1 to prevent repetable "+New" controls from showing on search inputs. additional-fields-entry.js New JS asset to be called by template files who require additional-fields-entry.inc for repeatable fields controls. This also handles the need for having the marcfield of type 'get' submitted if it is a disabled dropdown (AV marc field)
Created attachment 157328 [details] [review] Bug 35044: Update: Order baskets Test plan, k-t-d: Preparation: Create additional fields for table 'aqbasket': 2 text fields, one repeatable, one not-repeatable 2 AV fields, one repeatable, one not-repeatable 1) Add a new basket, visit: /cgi-bin/koha/acqui/basketheader.pl?booksellerid=1&op=add_form 2) Fill in name and all additional fields, click the '+New' and 'Clear' links, hit 'Save' 3) Notice the basket screen shows repeated fields separated by comma. 4) Notice that only non-null additional fields labels are shown. 5) Edit the basket. Notice all fields are shown as expected. Additional testing: Having a repeatable field with multiple instances, go back to the additional fields configuration and make the additional field non-repeatable again. Edit the basket again. Notice the multiple text instances are still shown, but the '+New' link no longer shows. You're able to remove existing multiple instances, but unable to add new ones, this is because the field is no longer repeatable.
Created attachment 157329 [details] [review] Bug 35044: Update: Acquisition orders Test plan, k-t-d: Preparation: Create additional fields for table 'aqorders': 2 text fields, one repeatable, one not-repeatable 2 AV fields, one repeatable, one not-repeatable 2 MARC fields, one 'get' and one 'set', both non-repeatable, MARC field 942$c Attempt to create a repeatable MARC field (get or set). Notice you're unable to. 1) Add a new order for an existing basket, with an existing record, visit: /cgi-bin/koha/acqui/neworderempty.pl?booksellerid=1&basketno=1&biblionumber=76 2) Set the mandatory "Koha item type" for the item. Click the 'Add item' button below. 3) Notice the accounting details now have quantity:1 4) Set the mandatory "Fund" input in accounting details. 5) At the bottom, fill in all additional fields, click the '+New' and 'Clear' links, hit 'Save' 6) In the orders table shown, click "Modify". Notice all the fields are presented correctly in the edit form.
Created attachment 157330 [details] [review] Bug 35044: Update: Invoices Added fixme comment to invoices.tt, the search works so nothing to do here, but the code is not DRY Test plan, k-t-d: Preparation: Create additional fields for table 'aqinvoices': 2 text fields, one repeatable, one not-repeatable 2 AV fields, one repeatable, one not-repeatable 1) Add a new invoice for an existing vendor, visit: /cgi-bin/koha/acqui/parcels.pl?booksellerid=1 2) Input something in the mandatory "Vendor invoice" field. 3) Fill in all additional fields, click the '+New' and 'Clear' links, hit 'Save' 4) Search for invoices, visit: http://localhost:8081/cgi-bin/koha/acqui/invoices.pl 5) Click "Search" on the left column of the page 6) Click the invoice we just created. Verify all the fields show correctly. 7) Go back to the additional fields configuration, set all additional fields as "searchable" 8) Return to http://localhost:8081/cgi-bin/koha/acqui/invoices.pl 9) Perform some searches using the additional fields values.
Created attachment 157331 [details] [review] Bug 35044: Update: Serial subscriptions Test plan, k-t-d: Preparation: Create additional fields for table 'subscription', visit: /cgi-bin/koha/admin/additional-fields.pl?tablename=subscription 2 text fields, one repeatable, one not-repeatable 2 AV fields, one repeatable, one not-repeatable 2 MARC fields, one 'get' and one 'set', both non-repeatable, MARC field 942$c Attempt to create a repeatable MARC field (get or set). Notice you're unable to. 1) Add a new serial subscription, visit: /cgi-bin/koha/serials/subscription-add.pl 2) Set the mandatory "Record" input (e.g. '112'). Click the 'Next' and press 'Ok' on the alert box. 3) Fill in all required fields and press "Test prediction pattern" 4) At the bottom, fill in all additional fields, click the '+New' and 'Clear' links, hit 'Save' 5) Notice the fields are shown, repeated fields are comma separated 6) Click Edit -> Edit Subscription, repeat steps 4 and 5 7) Go back to subscription additional fields, set all fields as searchable 8) Visit serials-home: /cgi-bin/koha/serials/serials-home.pl 9) Click 'Search' 10) Notice the searchable fields now show in their columns, repeated fields separated by comma 11) Perform a search using a repeatable field, verify it all works as expected. -- Subscription Claims -- Preparation: 1) Define a new claim notice, visit: /cgi-bin/koha/tools/letter.pl?op=add_form&module=claimissues 2) Input code, name, click "Email" set a "Message subject" and put something in the message body. Hit 'Save'. 3) Set a serial as late, visit our original subscription: /cgi-bin/koha/serials/serials-collection.pl?subscriptionid=1 4) Click "Edit serials" and status -> "Late". Hit "Save". 5) Link the original subscription to the existing vendor, visit: /cgi-bin/koha/serials/subscription-add.pl?op=modify&subscriptionid=1 6) Click "Search for a vendor". Hit "Ok". Hit "Choose". Save the subscription. Claims: 7) Visit claims: /cgi-bin/koha/serials/claims.pl 8) Click "Ok" 9) Verify that searchable additional fields all have their respective column. Repeated fields are shown comma separated.
Created attachment 157332 [details] [review] Bug 35044: Update: Serial subscriptions batch edit Test plan, k-t-d: Preparation: Create additional fields for table 'subscription', visit: /cgi-bin/koha/admin/additional-fields.pl?tablename=subscription 2 text fields, one repeatable, one not-repeatable 2 AV fields, one repeatable, one not-repeatable 2 MARC fields, one 'get' and one 'set', both non-repeatable, MARC field 942$c Attempt to create a repeatable MARC field (get or set). Notice you're unable to. 1) Add a new serial subscription, visit: /cgi-bin/koha/serials/subscription-add.pl 2) Set the mandatory "Record" input (e.g. '112'). Click the 'Next' and press 'Ok' on the alert box. 3) Fill in all required fields and press "Test prediction pattern" 4) At the bottom, fill in all additional fields, click the '+New' and 'Clear' links, hit 'Save' 5) Notice the fields are shown, repeated fields are comma separated 6) Repeat steps 1-4 to create a second subscription 7) Visit serials home and hit "Search": /cgi-bin/koha/serials/serials-home.pl 8) Check the checkboxes next to the 2 subscriptions and click "Edit selected serials" 9) Input some values in the additional fields section, click the '+New' and 'Clear' links, hit 'Save' 10) Verify that both subscriptions now have the new values form the batch edit.
Created attachment 157333 [details] [review] Bug 35044: Update: Manual invoices, manual credits and accountlines Test plan, k-t-d: Preparation: Create additional fields for table 'accountlines:credit', visit: /cgi-bin/koha/admin/additional-fields.pl?tablename=accountlines%3Acredit 2 text fields, one repeatable, one not-repeatable 2 AV fields, one repeatable, one not-repeatable 1) Add a new manual credit for admin borrower: /cgi-bin/koha/members/mancredit.pl?borrowernumber=51 2) Set the mandatory "Amount" input (e.g. '5'). Click the 'Next' and press 'Ok' on the alert box. 3) Fill in all additional fields, click the '+New' and 'Clear' links, hit 'Save' 4) On the table, click "Details" for the for account line we just created. 5) Notice the additional fields are there, repeated fields are comma separated. 6) Repeat the above test plan, but for accountlines:debit instead, visit: /cgi-bin/koha/admin/additional-fields.pl?tablename=accountlines%3Adebit 7) To add a manual invoice, visit: /cgi-bin/koha/members/maninvoice.pl?borrowernumber=51 --- Payments --- 8) Visit the transactions table, you should have at least 1 invoice from the above instructions: /cgi-bin/koha/members/boraccount.pl?borrowernumber=51 9) On the invoice table row, click "Pay" 10) Fill in all additional fields, click the '+New' and 'Clear' links, hit 'Save' 11) Repeat step 1: go back to the transactions table 12) Click the 'details' of the payment row. Notice the fields are all there, repeated fields comma separated. 13) Create a new manual invoice again (step 7) 14) Visit "Make a payment", visit: /cgi-bin/koha/members/pay.pl?borrowernumber=51 15) Click "write off" 16) Fill in all additional fields, click the '+New' and 'Clear' links, hit 'Save' 17) Go back to the transactions, visit: /cgi-bin/koha/members/boraccount.pl?borrowernumber=51 18) Click the 'details' of the writeoff row. Notice the additional fields are NOT there. This is a bug not caused by this development. See bug 35080
Created attachment 157334 [details] [review] Bug 35044: Add tests Test plan: prove t/db_dependent/Koha/Object/Mixin/AdditionalFields.t
Created attachment 158113 [details] [review] Bug 35044: Add repetable to REST API spec
Created attachment 158498 [details] [review] Bug 35044: [DONT PUSH] dbic specific
Created attachment 158499 [details] [review] Bug 35044: DB changes + atomicupdate file Add the 'repeatable' column to additional_fields Remove the unique key from additional_field_values as we will now be allowing for repeated instances of the same field_id + record_id
Created attachment 158500 [details] [review] Bug 35044: Admin: New additional fields 'repeatable' field There is now a new 'repeatable' checkbox when configuring (adding or editing) an additional field for a specific table. It is also displayed in a column in the additional fields panel for a given tablename. MARC fields are not allowed to be repeatable.
Created attachment 158501 [details] [review] Bug 35044: Preparation: get_additional_field_values_for_template method New method to be utilized for retrieval of additional fields of any class that implements it. This is to be used when additional_fields are needed to be sent to .tt files for renderering. Both for form entries and read-only 'show' pages. Template files: Updated additional-fields-entry.inc: Now considers entry of repeatable fields. Repeatable text fields will have a "+New" link to allow for adding of a new instance of a repeatable field. Repeatable AV fields will be shown as checkboxes instead of a dropdown Update additional-fields-display.inc When displaying non-editable additional-fields, multiple instances for each field are now considered. Label now only shows if field has a non-null value in it. Option to show value_only Option to set if its to be displayed on a table cell Update histsearch.tt and filter-orders.inc Now calls additional-fields-entry.inc with search_form=1 to prevent repetable "+New" controls from showing on search inputs. additional-fields-entry.js New JS asset to be called by template files who require additional-fields-entry.inc for repeatable fields controls. This also handles the need for having the marcfield of type 'get' submitted if it is a disabled dropdown (AV marc field)
Created attachment 158502 [details] [review] Bug 35044: Update: Order baskets Test plan, k-t-d: Preparation: Create additional fields for table 'aqbasket': 2 text fields, one repeatable, one not-repeatable 2 AV fields, one repeatable, one not-repeatable 1) Add a new basket, visit: /cgi-bin/koha/acqui/basketheader.pl?booksellerid=1&op=add_form 2) Fill in name and all additional fields, click the '+New' and 'Clear' links, hit 'Save' 3) Notice the basket screen shows repeated fields separated by comma. 4) Notice that only non-null additional fields labels are shown. 5) Edit the basket. Notice all fields are shown as expected. Additional testing: Having a repeatable field with multiple instances, go back to the additional fields configuration and make the additional field non-repeatable again. Edit the basket again. Notice the multiple text instances are still shown, but the '+New' link no longer shows. You're able to remove existing multiple instances, but unable to add new ones, this is because the field is no longer repeatable.
Created attachment 158503 [details] [review] Bug 35044: Update: Acquisition orders Test plan, k-t-d: Preparation: Create additional fields for table 'aqorders': 2 text fields, one repeatable, one not-repeatable 2 AV fields, one repeatable, one not-repeatable 2 MARC fields, one 'get' and one 'set', both non-repeatable, MARC field 942$c Attempt to create a repeatable MARC field (get or set). Notice you're unable to. 1) Add a new order for an existing basket, with an existing record, visit: /cgi-bin/koha/acqui/neworderempty.pl?booksellerid=1&basketno=1&biblionumber=76 2) Set the mandatory "Koha item type" for the item. Click the 'Add item' button below. 3) Notice the accounting details now have quantity:1 4) Set the mandatory "Fund" input in accounting details. 5) At the bottom, fill in all additional fields, click the '+New' and 'Clear' links, hit 'Save' 6) In the orders table shown, click "Modify". Notice all the fields are presented correctly in the edit form.
Created attachment 158504 [details] [review] Bug 35044: Update: Invoices Added fixme comment to invoices.tt, the search works so nothing to do here, but the code is not DRY Test plan, k-t-d: Preparation: Create additional fields for table 'aqinvoices': 2 text fields, one repeatable, one not-repeatable 2 AV fields, one repeatable, one not-repeatable 1) Add a new invoice for an existing vendor, visit: /cgi-bin/koha/acqui/parcels.pl?booksellerid=1 2) Input something in the mandatory "Vendor invoice" field. 3) Fill in all additional fields, click the '+New' and 'Clear' links, hit 'Save' 4) Search for invoices, visit: http://localhost:8081/cgi-bin/koha/acqui/invoices.pl 5) Click "Search" on the left column of the page 6) Click the invoice we just created. Verify all the fields show correctly. 7) Go back to the additional fields configuration, set all additional fields as "searchable" 8) Return to http://localhost:8081/cgi-bin/koha/acqui/invoices.pl 9) Perform some searches using the additional fields values.
Created attachment 158505 [details] [review] Bug 35044: Update: Serial subscriptions Test plan, k-t-d: Preparation: Create additional fields for table 'subscription', visit: /cgi-bin/koha/admin/additional-fields.pl?tablename=subscription 2 text fields, one repeatable, one not-repeatable 2 AV fields, one repeatable, one not-repeatable 2 MARC fields, one 'get' and one 'set', both non-repeatable, MARC field 942$c Attempt to create a repeatable MARC field (get or set). Notice you're unable to. 1) Add a new serial subscription, visit: /cgi-bin/koha/serials/subscription-add.pl 2) Set the mandatory "Record" input (e.g. '112'). Click the 'Next' and press 'Ok' on the alert box. 3) Fill in all required fields and press "Test prediction pattern" 4) At the bottom, fill in all additional fields, click the '+New' and 'Clear' links, hit 'Save' 5) Notice the fields are shown, repeated fields are comma separated 6) Click Edit -> Edit Subscription, repeat steps 4 and 5 7) Go back to subscription additional fields, set all fields as searchable 8) Visit serials-home: /cgi-bin/koha/serials/serials-home.pl 9) Click 'Search' 10) Notice the searchable fields now show in their columns, repeated fields separated by comma 11) Perform a search using a repeatable field, verify it all works as expected. -- Subscription Claims -- Preparation: 1) Define a new claim notice, visit: /cgi-bin/koha/tools/letter.pl?op=add_form&module=claimissues 2) Input code, name, click "Email" set a "Message subject" and put something in the message body. Hit 'Save'. 3) Set a serial as late, visit our original subscription: /cgi-bin/koha/serials/serials-collection.pl?subscriptionid=1 4) Click "Edit serials" and status -> "Late". Hit "Save". 5) Link the original subscription to the existing vendor, visit: /cgi-bin/koha/serials/subscription-add.pl?op=modify&subscriptionid=1 6) Click "Search for a vendor". Hit "Ok". Hit "Choose". Save the subscription. Claims: 7) Visit claims: /cgi-bin/koha/serials/claims.pl 8) Click "Ok" 9) Verify that searchable additional fields all have their respective column. Repeated fields are shown comma separated.
Created attachment 158506 [details] [review] Bug 35044: Update: Serial subscriptions batch edit Test plan, k-t-d: Preparation: Create additional fields for table 'subscription', visit: /cgi-bin/koha/admin/additional-fields.pl?tablename=subscription 2 text fields, one repeatable, one not-repeatable 2 AV fields, one repeatable, one not-repeatable 2 MARC fields, one 'get' and one 'set', both non-repeatable, MARC field 942$c Attempt to create a repeatable MARC field (get or set). Notice you're unable to. 1) Add a new serial subscription, visit: /cgi-bin/koha/serials/subscription-add.pl 2) Set the mandatory "Record" input (e.g. '112'). Click the 'Next' and press 'Ok' on the alert box. 3) Fill in all required fields and press "Test prediction pattern" 4) At the bottom, fill in all additional fields, click the '+New' and 'Clear' links, hit 'Save' 5) Notice the fields are shown, repeated fields are comma separated 6) Repeat steps 1-4 to create a second subscription 7) Visit serials home and hit "Search": /cgi-bin/koha/serials/serials-home.pl 8) Check the checkboxes next to the 2 subscriptions and click "Edit selected serials" 9) Input some values in the additional fields section, click the '+New' and 'Clear' links, hit 'Save' 10) Verify that both subscriptions now have the new values form the batch edit.
Created attachment 158507 [details] [review] Bug 35044: Update: Manual invoices, manual credits and accountlines Test plan, k-t-d: Preparation: Create additional fields for table 'accountlines:credit', visit: /cgi-bin/koha/admin/additional-fields.pl?tablename=accountlines%3Acredit 2 text fields, one repeatable, one not-repeatable 2 AV fields, one repeatable, one not-repeatable 1) Add a new manual credit for admin borrower: /cgi-bin/koha/members/mancredit.pl?borrowernumber=51 2) Set the mandatory "Amount" input (e.g. '5'). Click the 'Next' and press 'Ok' on the alert box. 3) Fill in all additional fields, click the '+New' and 'Clear' links, hit 'Save' 4) On the table, click "Details" for the for account line we just created. 5) Notice the additional fields are there, repeated fields are comma separated. 6) Repeat the above test plan, but for accountlines:debit instead, visit: /cgi-bin/koha/admin/additional-fields.pl?tablename=accountlines%3Adebit 7) To add a manual invoice, visit: /cgi-bin/koha/members/maninvoice.pl?borrowernumber=51
Created attachment 158508 [details] [review] Bug 35044: Add tests Test plan: prove t/db_dependent/Koha/Object/Mixin/AdditionalFields.t
Rebased on top of bug 35190
Created attachment 158857 [details] [review] Bug 35044: [DONT PUSH] dbic specific
Created attachment 158858 [details] [review] Bug 35044: DB changes + atomicupdate file Add the 'repeatable' column to additional_fields Remove the unique key from additional_field_values as we will now be allowing for repeated instances of the same field_id + record_id
Created attachment 158859 [details] [review] Bug 35044: Admin: New additional fields 'repeatable' field There is now a new 'repeatable' checkbox when configuring (adding or editing) an additional field for a specific table. It is also displayed in a column in the additional fields panel for a given tablename. MARC fields are not allowed to be repeatable.
Created attachment 158860 [details] [review] Bug 35044: Preparation: get_additional_field_values_for_template method New method to be utilized for retrieval of additional fields of any class that implements it. This is to be used when additional_fields are needed to be sent to .tt files for renderering. Both for form entries and read-only 'show' pages. Template files: Updated additional-fields-entry.inc: Now considers entry of repeatable fields. Repeatable text fields will have a "+New" link to allow for adding of a new instance of a repeatable field. Repeatable AV fields will be shown as checkboxes instead of a dropdown Update additional-fields-display.inc When displaying non-editable additional-fields, multiple instances for each field are now considered. Label now only shows if field has a non-null value in it. Option to show value_only Option to set if its to be displayed on a table cell Update histsearch.tt and filter-orders.inc Now calls additional-fields-entry.inc with search_form=1 to prevent repetable "+New" controls from showing on search inputs. additional-fields-entry.js New JS asset to be called by template files who require additional-fields-entry.inc for repeatable fields controls. This also handles the need for having the marcfield of type 'get' submitted if it is a disabled dropdown (AV marc field)
Created attachment 158861 [details] [review] Bug 35044: Update: Order baskets Test plan, k-t-d: Preparation: Create additional fields for table 'aqbasket': 2 text fields, one repeatable, one not-repeatable 2 AV fields, one repeatable, one not-repeatable 1) Add a new basket, visit: /cgi-bin/koha/acqui/basketheader.pl?booksellerid=1&op=add_form 2) Fill in name and all additional fields, click the '+New' and 'Clear' links, hit 'Save' 3) Notice the basket screen shows repeated fields separated by comma. 4) Notice that only non-null additional fields labels are shown. 5) Edit the basket. Notice all fields are shown as expected. Additional testing: Having a repeatable field with multiple instances, go back to the additional fields configuration and make the additional field non-repeatable again. Edit the basket again. Notice the multiple text instances are still shown, but the '+New' link no longer shows. You're able to remove existing multiple instances, but unable to add new ones, this is because the field is no longer repeatable.
Created attachment 158862 [details] [review] Bug 35044: Update: Acquisition orders Test plan, k-t-d: Preparation: Create additional fields for table 'aqorders': 2 text fields, one repeatable, one not-repeatable 2 AV fields, one repeatable, one not-repeatable 2 MARC fields, one 'get' and one 'set', both non-repeatable, MARC field 942$c Attempt to create a repeatable MARC field (get or set). Notice you're unable to. 1) Add a new order for an existing basket, with an existing record, visit: /cgi-bin/koha/acqui/neworderempty.pl?booksellerid=1&basketno=1&biblionumber=76 2) Set the mandatory "Koha item type" for the item. Click the 'Add item' button below. 3) Notice the accounting details now have quantity:1 4) Set the mandatory "Fund" input in accounting details. 5) At the bottom, fill in all additional fields, click the '+New' and 'Clear' links, hit 'Save' 6) In the orders table shown, click "Modify". Notice all the fields are presented correctly in the edit form.
Created attachment 158863 [details] [review] Bug 35044: Update: Invoices Added fixme comment to invoices.tt, the search works so nothing to do here, but the code is not DRY Test plan, k-t-d: Preparation: Create additional fields for table 'aqinvoices': 2 text fields, one repeatable, one not-repeatable 2 AV fields, one repeatable, one not-repeatable 1) Add a new invoice for an existing vendor, visit: /cgi-bin/koha/acqui/parcels.pl?booksellerid=1 2) Input something in the mandatory "Vendor invoice" field. 3) Fill in all additional fields, click the '+New' and 'Clear' links, hit 'Save' 4) Search for invoices, visit: http://localhost:8081/cgi-bin/koha/acqui/invoices.pl 5) Click "Search" on the left column of the page 6) Click the invoice we just created. Verify all the fields show correctly. 7) Go back to the additional fields configuration, set all additional fields as "searchable" 8) Return to http://localhost:8081/cgi-bin/koha/acqui/invoices.pl 9) Perform some searches using the additional fields values.
Created attachment 158864 [details] [review] Bug 35044: Update: Serial subscriptions Test plan, k-t-d: Preparation: Create additional fields for table 'subscription', visit: /cgi-bin/koha/admin/additional-fields.pl?tablename=subscription 2 text fields, one repeatable, one not-repeatable 2 AV fields, one repeatable, one not-repeatable 2 MARC fields, one 'get' and one 'set', both non-repeatable, MARC field 942$c Attempt to create a repeatable MARC field (get or set). Notice you're unable to. 1) Add a new serial subscription, visit: /cgi-bin/koha/serials/subscription-add.pl 2) Set the mandatory "Record" input (e.g. '112'). Click the 'Next' and press 'Ok' on the alert box. 3) Fill in all required fields and press "Test prediction pattern" 4) At the bottom, fill in all additional fields, click the '+New' and 'Clear' links, hit 'Save' 5) Notice the fields are shown, repeated fields are comma separated 6) Click Edit -> Edit Subscription, repeat steps 4 and 5 7) Go back to subscription additional fields, set all fields as searchable 8) Visit serials-home: /cgi-bin/koha/serials/serials-home.pl 9) Click 'Search' 10) Notice the searchable fields now show in their columns, repeated fields separated by comma 11) Perform a search using a repeatable field, verify it all works as expected. -- Subscription Claims -- Preparation: 1) Define a new claim notice, visit: /cgi-bin/koha/tools/letter.pl?op=add_form&module=claimissues 2) Input code, name, click "Email" set a "Message subject" and put something in the message body. Hit 'Save'. 3) Set a serial as late, visit our original subscription: /cgi-bin/koha/serials/serials-collection.pl?subscriptionid=1 4) Click "Edit serials" and status -> "Late". Hit "Save". 5) Link the original subscription to the existing vendor, visit: /cgi-bin/koha/serials/subscription-add.pl?op=modify&subscriptionid=1 6) Click "Search for a vendor". Hit "Ok". Hit "Choose". Save the subscription. Claims: 7) Visit claims: /cgi-bin/koha/serials/claims.pl 8) Click "Ok" 9) Verify that searchable additional fields all have their respective column. Repeated fields are shown comma separated.
Created attachment 158865 [details] [review] Bug 35044: Update: Serial subscriptions batch edit Test plan, k-t-d: Preparation: Create additional fields for table 'subscription', visit: /cgi-bin/koha/admin/additional-fields.pl?tablename=subscription 2 text fields, one repeatable, one not-repeatable 2 AV fields, one repeatable, one not-repeatable 2 MARC fields, one 'get' and one 'set', both non-repeatable, MARC field 942$c Attempt to create a repeatable MARC field (get or set). Notice you're unable to. 1) Add a new serial subscription, visit: /cgi-bin/koha/serials/subscription-add.pl 2) Set the mandatory "Record" input (e.g. '112'). Click the 'Next' and press 'Ok' on the alert box. 3) Fill in all required fields and press "Test prediction pattern" 4) At the bottom, fill in all additional fields, click the '+New' and 'Clear' links, hit 'Save' 5) Notice the fields are shown, repeated fields are comma separated 6) Repeat steps 1-4 to create a second subscription 7) Visit serials home and hit "Search": /cgi-bin/koha/serials/serials-home.pl 8) Check the checkboxes next to the 2 subscriptions and click "Edit selected serials" 9) Input some values in the additional fields section, click the '+New' and 'Clear' links, hit 'Save' 10) Verify that both subscriptions now have the new values form the batch edit.
Created attachment 158866 [details] [review] Bug 35044: Update: Manual invoices, manual credits and accountlines Test plan, k-t-d: Preparation: Create additional fields for table 'accountlines:credit', visit: /cgi-bin/koha/admin/additional-fields.pl?tablename=accountlines%3Acredit 2 text fields, one repeatable, one not-repeatable 2 AV fields, one repeatable, one not-repeatable 1) Add a new manual credit for admin borrower: /cgi-bin/koha/members/mancredit.pl?borrowernumber=51 2) Set the mandatory "Amount" input (e.g. '5'). Click the 'Next' and press 'Ok' on the alert box. 3) Fill in all additional fields, click the '+New' and 'Clear' links, hit 'Save' 4) On the table, click "Details" for the for account line we just created. 5) Notice the additional fields are there, repeated fields are comma separated. 6) Repeat the above test plan, but for accountlines:debit instead, visit: /cgi-bin/koha/admin/additional-fields.pl?tablename=accountlines%3Adebit 7) To add a manual invoice, visit: /cgi-bin/koha/members/maninvoice.pl?borrowernumber=51
Created attachment 158867 [details] [review] Bug 35044: Add repetable to REST API spec
Created attachment 158868 [details] [review] Bug 35044: Add tests Test plan: prove t/db_dependent/Koha/Object/Mixin/AdditionalFields.t
Rebased on bug 34708
Created attachment 159268 [details] [review] Bug 35044: (QA Follow-up) Fix atomicupdate Was missing bug number and correct filename Was checking for the wrong unique key name, existing unique key name is 'field_record', not 'afv_fk'
Created attachment 160177 [details] [review] Bug 35044: [DONT PUSH] dbic specific Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 160178 [details] [review] Bug 35044: DB changes + atomicupdate file Add the 'repeatable' column to additional_fields Remove the unique key from additional_field_values as we will now be allowing for repeated instances of the same field_id + record_id Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 160179 [details] [review] Bug 35044: Admin: New additional fields 'repeatable' field There is now a new 'repeatable' checkbox when configuring (adding or editing) an additional field for a specific table. It is also displayed in a column in the additional fields panel for a given tablename. MARC fields are not allowed to be repeatable. Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 160180 [details] [review] Bug 35044: Preparation: get_additional_field_values_for_template method New method to be utilized for retrieval of additional fields of any class that implements it. This is to be used when additional_fields are needed to be sent to .tt files for renderering. Both for form entries and read-only 'show' pages. Template files: Updated additional-fields-entry.inc: Now considers entry of repeatable fields. Repeatable text fields will have a "+New" link to allow for adding of a new instance of a repeatable field. Repeatable AV fields will be shown as checkboxes instead of a dropdown Update additional-fields-display.inc When displaying non-editable additional-fields, multiple instances for each field are now considered. Label now only shows if field has a non-null value in it. Option to show value_only Option to set if its to be displayed on a table cell Update histsearch.tt and filter-orders.inc Now calls additional-fields-entry.inc with search_form=1 to prevent repetable "+New" controls from showing on search inputs. additional-fields-entry.js New JS asset to be called by template files who require additional-fields-entry.inc for repeatable fields controls. This also handles the need for having the marcfield of type 'get' submitted if it is a disabled dropdown (AV marc field) Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 160181 [details] [review] Bug 35044: Update: Order baskets Test plan, k-t-d: Preparation: Create additional fields for table 'aqbasket': 2 text fields, one repeatable, one not-repeatable 2 AV fields, one repeatable, one not-repeatable 1) Add a new basket, visit: /cgi-bin/koha/acqui/basketheader.pl?booksellerid=1&op=add_form 2) Fill in name and all additional fields, click the '+New' and 'Clear' links, hit 'Save' 3) Notice the basket screen shows repeated fields separated by comma. 4) Notice that only non-null additional fields labels are shown. 5) Edit the basket. Notice all fields are shown as expected. Additional testing: Having a repeatable field with multiple instances, go back to the additional fields configuration and make the additional field non-repeatable again. Edit the basket again. Notice the multiple text instances are still shown, but the '+New' link no longer shows. You're able to remove existing multiple instances, but unable to add new ones, this is because the field is no longer repeatable. Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 160182 [details] [review] Bug 35044: Update: Acquisition orders Test plan, k-t-d: Preparation: Create additional fields for table 'aqorders': 2 text fields, one repeatable, one not-repeatable 2 AV fields, one repeatable, one not-repeatable 2 MARC fields, one 'get' and one 'set', both non-repeatable, MARC field 942$c Attempt to create a repeatable MARC field (get or set). Notice you're unable to. 1) Add a new order for an existing basket, with an existing record, visit: /cgi-bin/koha/acqui/neworderempty.pl?booksellerid=1&basketno=1&biblionumber=76 2) Set the mandatory "Koha item type" for the item. Click the 'Add item' button below. 3) Notice the accounting details now have quantity:1 4) Set the mandatory "Fund" input in accounting details. 5) At the bottom, fill in all additional fields, click the '+New' and 'Clear' links, hit 'Save' 6) In the orders table shown, click "Modify". Notice all the fields are presented correctly in the edit form. Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 160183 [details] [review] Bug 35044: Update: Invoices Added fixme comment to invoices.tt, the search works so nothing to do here, but the code is not DRY Test plan, k-t-d: Preparation: Create additional fields for table 'aqinvoices': 2 text fields, one repeatable, one not-repeatable 2 AV fields, one repeatable, one not-repeatable 1) Add a new invoice for an existing vendor, visit: /cgi-bin/koha/acqui/parcels.pl?booksellerid=1 2) Input something in the mandatory "Vendor invoice" field. 3) Fill in all additional fields, click the '+New' and 'Clear' links, hit 'Save' 4) Search for invoices, visit: http://localhost:8081/cgi-bin/koha/acqui/invoices.pl 5) Click "Search" on the left column of the page 6) Click the invoice we just created. Verify all the fields show correctly. 7) Go back to the additional fields configuration, set all additional fields as "searchable" 8) Return to http://localhost:8081/cgi-bin/koha/acqui/invoices.pl 9) Perform some searches using the additional fields values. Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 160184 [details] [review] Bug 35044: Update: Serial subscriptions Test plan, k-t-d: Preparation: Create additional fields for table 'subscription', visit: /cgi-bin/koha/admin/additional-fields.pl?tablename=subscription 2 text fields, one repeatable, one not-repeatable 2 AV fields, one repeatable, one not-repeatable 2 MARC fields, one 'get' and one 'set', both non-repeatable, MARC field 942$c Attempt to create a repeatable MARC field (get or set). Notice you're unable to. 1) Add a new serial subscription, visit: /cgi-bin/koha/serials/subscription-add.pl 2) Set the mandatory "Record" input (e.g. '112'). Click the 'Next' and press 'Ok' on the alert box. 3) Fill in all required fields and press "Test prediction pattern" 4) At the bottom, fill in all additional fields, click the '+New' and 'Clear' links, hit 'Save' 5) Notice the fields are shown, repeated fields are comma separated 6) Click Edit -> Edit Subscription, repeat steps 4 and 5 7) Go back to subscription additional fields, set all fields as searchable 8) Visit serials-home: /cgi-bin/koha/serials/serials-home.pl 9) Click 'Search' 10) Notice the searchable fields now show in their columns, repeated fields separated by comma 11) Perform a search using a repeatable field, verify it all works as expected. -- Subscription Claims -- Preparation: 1) Define a new claim notice, visit: /cgi-bin/koha/tools/letter.pl?op=add_form&module=claimissues 2) Input code, name, click "Email" set a "Message subject" and put something in the message body. Hit 'Save'. 3) Set a serial as late, visit our original subscription: /cgi-bin/koha/serials/serials-collection.pl?subscriptionid=1 4) Click "Edit serials" and status -> "Late". Hit "Save". 5) Link the original subscription to the existing vendor, visit: /cgi-bin/koha/serials/subscription-add.pl?op=modify&subscriptionid=1 6) Click "Search for a vendor". Hit "Ok". Hit "Choose". Save the subscription. Claims: 7) Visit claims: /cgi-bin/koha/serials/claims.pl 8) Click "Ok" 9) Verify that searchable additional fields all have their respective column. Repeated fields are shown comma separated. Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 160185 [details] [review] Bug 35044: Update: Serial subscriptions batch edit Test plan, k-t-d: Preparation: Create additional fields for table 'subscription', visit: /cgi-bin/koha/admin/additional-fields.pl?tablename=subscription 2 text fields, one repeatable, one not-repeatable 2 AV fields, one repeatable, one not-repeatable 2 MARC fields, one 'get' and one 'set', both non-repeatable, MARC field 942$c Attempt to create a repeatable MARC field (get or set). Notice you're unable to. 1) Add a new serial subscription, visit: /cgi-bin/koha/serials/subscription-add.pl 2) Set the mandatory "Record" input (e.g. '112'). Click the 'Next' and press 'Ok' on the alert box. 3) Fill in all required fields and press "Test prediction pattern" 4) At the bottom, fill in all additional fields, click the '+New' and 'Clear' links, hit 'Save' 5) Notice the fields are shown, repeated fields are comma separated 6) Repeat steps 1-4 to create a second subscription 7) Visit serials home and hit "Search": /cgi-bin/koha/serials/serials-home.pl 8) Check the checkboxes next to the 2 subscriptions and click "Edit selected serials" 9) Input some values in the additional fields section, click the '+New' and 'Clear' links, hit 'Save' 10) Verify that both subscriptions now have the new values form the batch edit. Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 160186 [details] [review] Bug 35044: Update: Manual invoices, manual credits and accountlines Test plan, k-t-d: Preparation: Create additional fields for table 'accountlines:credit', visit: /cgi-bin/koha/admin/additional-fields.pl?tablename=accountlines%3Acredit 2 text fields, one repeatable, one not-repeatable 2 AV fields, one repeatable, one not-repeatable 1) Add a new manual credit for admin borrower: /cgi-bin/koha/members/mancredit.pl?borrowernumber=51 2) Set the mandatory "Amount" input (e.g. '5'). Click the 'Next' and press 'Ok' on the alert box. 3) Fill in all additional fields, click the '+New' and 'Clear' links, hit 'Save' 4) On the table, click "Details" for the for account line we just created. 5) Notice the additional fields are there, repeated fields are comma separated. 6) Repeat the above test plan, but for accountlines:debit instead, visit: /cgi-bin/koha/admin/additional-fields.pl?tablename=accountlines%3Adebit 7) To add a manual invoice, visit: /cgi-bin/koha/members/maninvoice.pl?borrowernumber=51 Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 160187 [details] [review] Bug 35044: Add repetable to REST API spec Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 160188 [details] [review] Bug 35044: Add tests Test plan: prove t/db_dependent/Koha/Object/Mixin/AdditionalFields.t Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 160189 [details] [review] Bug 35044: (QA Follow-up) Fix atomicupdate Was missing bug number and correct filename Was checking for the wrong unique key name, existing unique key name is 'field_record', not 'afv_fk' Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Tested thoroughly and I'm really happy with the results here. There's one caveat, which I've already discussed with Pedro and we came to the conclusion it was a feature rather than a bug. The repeatable implementation is all UI level, there's no check on store to prevent a non-repeatable field being repeated.. this means if you're so inclined you could carefully craft a request to add an additional field value for a field marked non-repeatable. However, given that you can flick between repeatable/non-repeatable in the UI easily (and that doesn't cleanup existing repeated value's as we felt it least destructive to keep the data around) and you can remove existing repeated value's, but not add new ones to a newly marked non-repeatable field this covers the use cases nicely. Signing off.
Patches no longer apply 8-(.... git bz apply 35044 Bug 35044 Depends on bug 35197 (Signed Off) Follow? [(y)es, (n)o] y Bug 35197 - Expose additional_field definitions through REST API 159648 - Bug 35197: Add additional_fields REST API endpoint 159649 - Bug 35197: Add tests 159650 - Bug 35197: Field name consistency Apply? [(y)es, (n)o, (i)nteractive] y Applying: Bug 35197: Add additional_fields REST API endpoint Applying: Bug 35197: Add tests Applying: Bug 35197: Field name consistency Bug 35044 - Additional fields: Allow for repeatable fields 160177 - Bug 35044: [DONT PUSH] dbic specific 160178 - Bug 35044: DB changes + atomicupdate file 160179 - Bug 35044: Admin: New additional fields 'repeatable' field 160180 - Bug 35044: Preparation: 160181 - Bug 35044: Update: Order baskets 160182 - Bug 35044: Update: Acquisition orders 160183 - Bug 35044: Update: Invoices 160184 - Bug 35044: Update: Serial subscriptions 160185 - Bug 35044: Update: Serial subscriptions batch edit 160186 - Bug 35044: Update: Manual invoices, manual credits and accountlines 160187 - Bug 35044: Add repetable to REST API spec 160188 - Bug 35044: Add tests 160189 - Bug 35044: (QA Follow-up) Fix atomicupdate Apply? [(y)es, (n)o, (i)nteractive] y Applying: Bug 35044: [DONT PUSH] dbic specific Applying: Bug 35044: DB changes + atomicupdate file Applying: Bug 35044: Admin: New additional fields 'repeatable' field Applying: Bug 35044: Preparation: Applying: Bug 35044: Update: Order baskets Applying: Bug 35044: Update: Acquisition orders Using index info to reconstruct a base tree... M acqui/addorder.pl M acqui/neworderempty.pl M koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tt Falling back to patching base and 3-way merge... Auto-merging koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tt Auto-merging acqui/neworderempty.pl Auto-merging acqui/addorder.pl CONFLICT (content): Merge conflict in acqui/addorder.pl error: Failed to merge in the changes. Patch failed at 0001 Bug 35044: Update: Acquisition orders
Created attachment 164162 [details] [review] Bug 35044: [DONT PUSH] dbic specific Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 164163 [details] [review] Bug 35044: DB changes + atomicupdate file Add the 'repeatable' column to additional_fields Remove the unique key from additional_field_values as we will now be allowing for repeated instances of the same field_id + record_id Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 164164 [details] [review] Bug 35044: Admin: New additional fields 'repeatable' field There is now a new 'repeatable' checkbox when configuring (adding or editing) an additional field for a specific table. It is also displayed in a column in the additional fields panel for a given tablename. MARC fields are not allowed to be repeatable. Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 164165 [details] [review] Bug 35044: Preparation: get_additional_field_values_for_template method New method to be utilized for retrieval of additional fields of any class that implements it. This is to be used when additional_fields are needed to be sent to .tt files for renderering. Both for form entries and read-only 'show' pages. Template files: Updated additional-fields-entry.inc: Now considers entry of repeatable fields. Repeatable text fields will have a "+New" link to allow for adding of a new instance of a repeatable field. Repeatable AV fields will be shown as checkboxes instead of a dropdown Update additional-fields-display.inc When displaying non-editable additional-fields, multiple instances for each field are now considered. Label now only shows if field has a non-null value in it. Option to show value_only Option to set if its to be displayed on a table cell Update histsearch.tt and filter-orders.inc Now calls additional-fields-entry.inc with search_form=1 to prevent repetable "+New" controls from showing on search inputs. additional-fields-entry.js New JS asset to be called by template files who require additional-fields-entry.inc for repeatable fields controls. This also handles the need for having the marcfield of type 'get' submitted if it is a disabled dropdown (AV marc field) Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 164166 [details] [review] Bug 35044: Update: Order baskets Test plan, k-t-d: Preparation: Create additional fields for table 'aqbasket': 2 text fields, one repeatable, one not-repeatable 2 AV fields, one repeatable, one not-repeatable 1) Add a new basket, visit: /cgi-bin/koha/acqui/basketheader.pl?booksellerid=1&op=add_form 2) Fill in name and all additional fields, click the '+New' and 'Clear' links, hit 'Save' 3) Notice the basket screen shows repeated fields separated by comma. 4) Notice that only non-null additional fields labels are shown. 5) Edit the basket. Notice all fields are shown as expected. Additional testing: Having a repeatable field with multiple instances, go back to the additional fields configuration and make the additional field non-repeatable again. Edit the basket again. Notice the multiple text instances are still shown, but the '+New' link no longer shows. You're able to remove existing multiple instances, but unable to add new ones, this is because the field is no longer repeatable. Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 164167 [details] [review] Bug 35044: Update: Acquisition orders Test plan, k-t-d: Preparation: Create additional fields for table 'aqorders': 2 text fields, one repeatable, one not-repeatable 2 AV fields, one repeatable, one not-repeatable 2 MARC fields, one 'get' and one 'set', both non-repeatable, MARC field 942$c Attempt to create a repeatable MARC field (get or set). Notice you're unable to. 1) Add a new order for an existing basket, with an existing record, visit: /cgi-bin/koha/acqui/neworderempty.pl?booksellerid=1&basketno=1&biblionumber=76 2) Set the mandatory "Koha item type" for the item. Click the 'Add item' button below. 3) Notice the accounting details now have quantity:1 4) Set the mandatory "Fund" input in accounting details. 5) At the bottom, fill in all additional fields, click the '+New' and 'Clear' links, hit 'Save' 6) In the orders table shown, click "Modify". Notice all the fields are presented correctly in the edit form. Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 164168 [details] [review] Bug 35044: Update: Invoices Added fixme comment to invoices.tt, the search works so nothing to do here, but the code is not DRY Test plan, k-t-d: Preparation: Create additional fields for table 'aqinvoices': 2 text fields, one repeatable, one not-repeatable 2 AV fields, one repeatable, one not-repeatable 1) Add a new invoice for an existing vendor, visit: /cgi-bin/koha/acqui/parcels.pl?booksellerid=1 2) Input something in the mandatory "Vendor invoice" field. 3) Fill in all additional fields, click the '+New' and 'Clear' links, hit 'Save' 4) Search for invoices, visit: http://localhost:8081/cgi-bin/koha/acqui/invoices.pl 5) Click "Search" on the left column of the page 6) Click the invoice we just created. Verify all the fields show correctly. 7) Go back to the additional fields configuration, set all additional fields as "searchable" 8) Return to http://localhost:8081/cgi-bin/koha/acqui/invoices.pl 9) Perform some searches using the additional fields values. Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 164169 [details] [review] Bug 35044: Update: Serial subscriptions Test plan, k-t-d: Preparation: Create additional fields for table 'subscription', visit: /cgi-bin/koha/admin/additional-fields.pl?tablename=subscription 2 text fields, one repeatable, one not-repeatable 2 AV fields, one repeatable, one not-repeatable 2 MARC fields, one 'get' and one 'set', both non-repeatable, MARC field 942$c Attempt to create a repeatable MARC field (get or set). Notice you're unable to. 1) Add a new serial subscription, visit: /cgi-bin/koha/serials/subscription-add.pl 2) Set the mandatory "Record" input (e.g. '112'). Click the 'Next' and press 'Ok' on the alert box. 3) Fill in all required fields and press "Test prediction pattern" 4) At the bottom, fill in all additional fields, click the '+New' and 'Clear' links, hit 'Save' 5) Notice the fields are shown, repeated fields are comma separated 6) Click Edit -> Edit Subscription, repeat steps 4 and 5 7) Go back to subscription additional fields, set all fields as searchable 8) Visit serials-home: /cgi-bin/koha/serials/serials-home.pl 9) Click 'Search' 10) Notice the searchable fields now show in their columns, repeated fields separated by comma 11) Perform a search using a repeatable field, verify it all works as expected. -- Subscription Claims -- Preparation: 1) Define a new claim notice, visit: /cgi-bin/koha/tools/letter.pl?op=add_form&module=claimissues 2) Input code, name, click "Email" set a "Message subject" and put something in the message body. Hit 'Save'. 3) Set a serial as late, visit our original subscription: /cgi-bin/koha/serials/serials-collection.pl?subscriptionid=1 4) Click "Edit serials" and status -> "Late". Hit "Save". 5) Link the original subscription to the existing vendor, visit: /cgi-bin/koha/serials/subscription-add.pl?op=modify&subscriptionid=1 6) Click "Search for a vendor". Hit "Ok". Hit "Choose". Save the subscription. Claims: 7) Visit claims: /cgi-bin/koha/serials/claims.pl 8) Click "Ok" 9) Verify that searchable additional fields all have their respective column. Repeated fields are shown comma separated. Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 164170 [details] [review] Bug 35044: Update: Serial subscriptions batch edit Test plan, k-t-d: Preparation: Create additional fields for table 'subscription', visit: /cgi-bin/koha/admin/additional-fields.pl?tablename=subscription 2 text fields, one repeatable, one not-repeatable 2 AV fields, one repeatable, one not-repeatable 2 MARC fields, one 'get' and one 'set', both non-repeatable, MARC field 942$c Attempt to create a repeatable MARC field (get or set). Notice you're unable to. 1) Add a new serial subscription, visit: /cgi-bin/koha/serials/subscription-add.pl 2) Set the mandatory "Record" input (e.g. '112'). Click the 'Next' and press 'Ok' on the alert box. 3) Fill in all required fields and press "Test prediction pattern" 4) At the bottom, fill in all additional fields, click the '+New' and 'Clear' links, hit 'Save' 5) Notice the fields are shown, repeated fields are comma separated 6) Repeat steps 1-4 to create a second subscription 7) Visit serials home and hit "Search": /cgi-bin/koha/serials/serials-home.pl 8) Check the checkboxes next to the 2 subscriptions and click "Edit selected serials" 9) Input some values in the additional fields section, click the '+New' and 'Clear' links, hit 'Save' 10) Verify that both subscriptions now have the new values form the batch edit. Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 164171 [details] [review] Bug 35044: Update: Manual invoices, manual credits and accountlines Test plan, k-t-d: Preparation: Create additional fields for table 'accountlines:credit', visit: /cgi-bin/koha/admin/additional-fields.pl?tablename=accountlines%3Acredit 2 text fields, one repeatable, one not-repeatable 2 AV fields, one repeatable, one not-repeatable 1) Add a new manual credit for admin borrower: /cgi-bin/koha/members/mancredit.pl?borrowernumber=51 2) Set the mandatory "Amount" input (e.g. '5'). Click the 'Next' and press 'Ok' on the alert box. 3) Fill in all additional fields, click the '+New' and 'Clear' links, hit 'Save' 4) On the table, click "Details" for the for account line we just created. 5) Notice the additional fields are there, repeated fields are comma separated. 6) Repeat the above test plan, but for accountlines:debit instead, visit: /cgi-bin/koha/admin/additional-fields.pl?tablename=accountlines%3Adebit 7) To add a manual invoice, visit: /cgi-bin/koha/members/maninvoice.pl?borrowernumber=51 Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 164172 [details] [review] Bug 35044: Add repetable to REST API spec Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 164173 [details] [review] Bug 35044: Add tests Test plan: prove t/db_dependent/Koha/Object/Mixin/AdditionalFields.t Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 164174 [details] [review] Bug 35044: (QA Follow-up) Fix atomicupdate Was missing bug number and correct filename Was checking for the wrong unique key name, existing unique key name is 'field_record', not 'afv_fk' Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
There's a trivial conflict in the "Update: Serial subscriptions" commit but after that there's another conflict(s) caused by the API follow-up changes added to the depending bug (bug 35197). For this reason I'm setting this to blocked.
Created attachment 167690 [details] [review] Bug 35044: 00-testcritic.t fix Squash to 'Update: Serial subscriptions'
Created attachment 168537 [details] [review] Bug 35044: [DONT PUSH] dbic specific Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 168538 [details] [review] Bug 35044: DB changes + atomicupdate file Add the 'repeatable' column to additional_fields Remove the unique key from additional_field_values as we will now be allowing for repeated instances of the same field_id + record_id Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 168539 [details] [review] Bug 35044: Admin: New additional fields 'repeatable' field There is now a new 'repeatable' checkbox when configuring (adding or editing) an additional field for a specific table. It is also displayed in a column in the additional fields panel for a given tablename. MARC fields are not allowed to be repeatable. Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 168540 [details] [review] Bug 35044: Preparation: get_additional_field_values_for_template method New method to be utilized for retrieval of additional fields of any class that implements it. This is to be used when additional_fields are needed to be sent to .tt files for renderering. Both for form entries and read-only 'show' pages. Template files: Updated additional-fields-entry.inc: Now considers entry of repeatable fields. Repeatable text fields will have a "+New" link to allow for adding of a new instance of a repeatable field. Repeatable AV fields will be shown as checkboxes instead of a dropdown Update additional-fields-display.inc When displaying non-editable additional-fields, multiple instances for each field are now considered. Label now only shows if field has a non-null value in it. Option to show value_only Option to set if its to be displayed on a table cell Update histsearch.tt and filter-orders.inc Now calls additional-fields-entry.inc with search_form=1 to prevent repetable "+New" controls from showing on search inputs. additional-fields-entry.js New JS asset to be called by template files who require additional-fields-entry.inc for repeatable fields controls. This also handles the need for having the marcfield of type 'get' submitted if it is a disabled dropdown (AV marc field) Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 168541 [details] [review] Bug 35044: Update: Order baskets Test plan, k-t-d: Preparation: Create additional fields for table 'aqbasket': 2 text fields, one repeatable, one not-repeatable 2 AV fields, one repeatable, one not-repeatable 1) Add a new basket, visit: /cgi-bin/koha/acqui/basketheader.pl?booksellerid=1&op=add_form 2) Fill in name and all additional fields, click the '+New' and 'Clear' links, hit 'Save' 3) Notice the basket screen shows repeated fields separated by comma. 4) Notice that only non-null additional fields labels are shown. 5) Edit the basket. Notice all fields are shown as expected. Additional testing: Having a repeatable field with multiple instances, go back to the additional fields configuration and make the additional field non-repeatable again. Edit the basket again. Notice the multiple text instances are still shown, but the '+New' link no longer shows. You're able to remove existing multiple instances, but unable to add new ones, this is because the field is no longer repeatable. Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 168542 [details] [review] Bug 35044: Update: Acquisition orders Test plan, k-t-d: Preparation: Create additional fields for table 'aqorders': 2 text fields, one repeatable, one not-repeatable 2 AV fields, one repeatable, one not-repeatable 2 MARC fields, one 'get' and one 'set', both non-repeatable, MARC field 942$c Attempt to create a repeatable MARC field (get or set). Notice you're unable to. 1) Add a new order for an existing basket, with an existing record, visit: /cgi-bin/koha/acqui/neworderempty.pl?booksellerid=1&basketno=1&biblionumber=76 2) Set the mandatory "Koha item type" for the item. Click the 'Add item' button below. 3) Notice the accounting details now have quantity:1 4) Set the mandatory "Fund" input in accounting details. 5) At the bottom, fill in all additional fields, click the '+New' and 'Clear' links, hit 'Save' 6) In the orders table shown, click "Modify". Notice all the fields are presented correctly in the edit form. Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 168543 [details] [review] Bug 35044: Update: Invoices Added fixme comment to invoices.tt, the search works so nothing to do here, but the code is not DRY Test plan, k-t-d: Preparation: Create additional fields for table 'aqinvoices': 2 text fields, one repeatable, one not-repeatable 2 AV fields, one repeatable, one not-repeatable 1) Add a new invoice for an existing vendor, visit: /cgi-bin/koha/acqui/parcels.pl?booksellerid=1 2) Input something in the mandatory "Vendor invoice" field. 3) Fill in all additional fields, click the '+New' and 'Clear' links, hit 'Save' 4) Search for invoices, visit: http://localhost:8081/cgi-bin/koha/acqui/invoices.pl 5) Click "Search" on the left column of the page 6) Click the invoice we just created. Verify all the fields show correctly. 7) Go back to the additional fields configuration, set all additional fields as "searchable" 8) Return to http://localhost:8081/cgi-bin/koha/acqui/invoices.pl 9) Perform some searches using the additional fields values. Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 168544 [details] [review] Bug 35044: Update: Serial subscriptions Test plan, k-t-d: Preparation: Create additional fields for table 'subscription', visit: /cgi-bin/koha/admin/additional-fields.pl?tablename=subscription 2 text fields, one repeatable, one not-repeatable 2 AV fields, one repeatable, one not-repeatable 2 MARC fields, one 'get' and one 'set', both non-repeatable, MARC field 942$c Attempt to create a repeatable MARC field (get or set). Notice you're unable to. 1) Add a new serial subscription, visit: /cgi-bin/koha/serials/subscription-add.pl 2) Set the mandatory "Record" input (e.g. '112'). Click the 'Next' and press 'Ok' on the alert box. 3) Fill in all required fields and press "Test prediction pattern" 4) At the bottom, fill in all additional fields, click the '+New' and 'Clear' links, hit 'Save' 5) Notice the fields are shown, repeated fields are comma separated 6) Click Edit -> Edit Subscription, repeat steps 4 and 5 7) Go back to subscription additional fields, set all fields as searchable 8) Visit serials-home: /cgi-bin/koha/serials/serials-home.pl 9) Click 'Search' 10) Notice the searchable fields now show in their columns, repeated fields separated by comma 11) Perform a search using a repeatable field, verify it all works as expected. -- Subscription Claims -- Preparation: 1) Define a new claim notice, visit: /cgi-bin/koha/tools/letter.pl?op=add_form&module=claimissues 2) Input code, name, click "Email" set a "Message subject" and put something in the message body. Hit 'Save'. 3) Set a serial as late, visit our original subscription: /cgi-bin/koha/serials/serials-collection.pl?subscriptionid=1 4) Click "Edit serials" and status -> "Late". Hit "Save". 5) Link the original subscription to the existing vendor, visit: /cgi-bin/koha/serials/subscription-add.pl?op=modify&subscriptionid=1 6) Click "Search for a vendor". Hit "Ok". Hit "Choose". Save the subscription. Claims: 7) Visit claims: /cgi-bin/koha/serials/claims.pl 8) Click "Ok" 9) Verify that searchable additional fields all have their respective column. Repeated fields are shown comma separated. Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 168545 [details] [review] Bug 35044: Update: Serial subscriptions batch edit Test plan, k-t-d: Preparation: Create additional fields for table 'subscription', visit: /cgi-bin/koha/admin/additional-fields.pl?tablename=subscription 2 text fields, one repeatable, one not-repeatable 2 AV fields, one repeatable, one not-repeatable 2 MARC fields, one 'get' and one 'set', both non-repeatable, MARC field 942$c Attempt to create a repeatable MARC field (get or set). Notice you're unable to. 1) Add a new serial subscription, visit: /cgi-bin/koha/serials/subscription-add.pl 2) Set the mandatory "Record" input (e.g. '112'). Click the 'Next' and press 'Ok' on the alert box. 3) Fill in all required fields and press "Test prediction pattern" 4) At the bottom, fill in all additional fields, click the '+New' and 'Clear' links, hit 'Save' 5) Notice the fields are shown, repeated fields are comma separated 6) Repeat steps 1-4 to create a second subscription 7) Visit serials home and hit "Search": /cgi-bin/koha/serials/serials-home.pl 8) Check the checkboxes next to the 2 subscriptions and click "Edit selected serials" 9) Input some values in the additional fields section, click the '+New' and 'Clear' links, hit 'Save' 10) Verify that both subscriptions now have the new values form the batch edit. Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 168546 [details] [review] Bug 35044: Update: Manual invoices, manual credits and accountlines Test plan, k-t-d: Preparation: Create additional fields for table 'accountlines:credit', visit: /cgi-bin/koha/admin/additional-fields.pl?tablename=accountlines%3Acredit 2 text fields, one repeatable, one not-repeatable 2 AV fields, one repeatable, one not-repeatable 1) Add a new manual credit for admin borrower: /cgi-bin/koha/members/mancredit.pl?borrowernumber=51 2) Set the mandatory "Amount" input (e.g. '5'). Click the 'Next' and press 'Ok' on the alert box. 3) Fill in all additional fields, click the '+New' and 'Clear' links, hit 'Save' 4) On the table, click "Details" for the for account line we just created. 5) Notice the additional fields are there, repeated fields are comma separated. 6) Repeat the above test plan, but for accountlines:debit instead, visit: /cgi-bin/koha/admin/additional-fields.pl?tablename=accountlines%3Adebit 7) To add a manual invoice, visit: /cgi-bin/koha/members/maninvoice.pl?borrowernumber=51 Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 168547 [details] [review] Bug 35044: Add repetable to REST API spec Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 168548 [details] [review] Bug 35044: Add tests Test plan: prove t/db_dependent/Koha/Object/Mixin/AdditionalFields.t Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This is now rebased on bug 35197 state pushed to main. This is now depending on bug 37262 as that is a follow-up required to fix some issues introduced by last changes in bug 35197.
1) In the patches: > #FIXME: The above $subscription->{additional_fields} may be redundant. Remove if so. Can it be checked/fixed now ? 2) With the patches it is no longer possible to save a "falsy" value like '' or '0'. That's a regression and it would be nice to add a test for that. 3) I was a bit surprised when I realized that repeatable AV fields are not actually repeatable. There is no "+ New" button like with other repeatable fields. It makes sense in this case to have a list of checkboxes instead of a repeatable dropdown list, but I didn't expect that. So maybe the issue is with the term "repeatable". I think that "multivalued" would fit better. Is it feasible to change that term without too much work ? Can anyone else from QA team or release team give their opinion on this ? Failing QA for 1 and 2
(In reply to Julian Maurice from comment #82) > Is it feasible to change that term without too much work ? Just in case: it can be done by using format-patch then applying some regexps on the .patch files and re-applying the patches. I can attach the modified patches if needed
Created attachment 169545 [details] [review] Bug 35044: (QA follow-up): DRY code before set_additional_fields
Created attachment 169546 [details] [review] Bug 35044: (QA follow-up): Allow for value '0' in additional fields This now allows for value '0' for an additional field (repeatable or not). This still does not allow for an empty '' field in additional fields. This is consistent with borrower patron attributes, i.e. if you submit an empty borrower patron attribute entry, it does not store it as empty. Additionally, if you have a value in a borrower patron attribute but then submit the form with that field as empty, it gets deleted from the database. I agree not being able to save the value '0' is a blocker, but not the empty. For consistency sake I'm keeping this as is, I don't see a use-case where a row with an empty field value is preferred over it not existing. If we allow for '' values of additional fields, the 'clear' button for repeatable fields would have to remove the input instead of clearing the value (or else how would the user remove repeatable fields entries?). If this is done, it's inconsistent with the repeatable fields from patron attribute types, as in that instance the 'clear' button only removes the input contents, not the input element itself. prove t/db_dependent/Koha/Object/Mixin/AdditionalFields.t
Created attachment 169547 [details] [review] Bug 35044: (QA follow-up): Remove FIXME and redundant code prove t/db_dependent/Koha/Acquisition/Booksellers.t prove t/db_dependent/Serials.t
(In reply to Julian Maurice from comment #82) > 1) In the patches: > > #FIXME: The above $subscription->{additional_fields} may be redundant. Remove if so. > Can it be checked/fixed now ? > > 2) With the patches it is no longer possible to save a "falsy" value like '' > or '0'. That's a regression and it would be nice to add a test for that. > > 3) I was a bit surprised when I realized that repeatable AV fields are not > actually repeatable. There is no "+ New" button like with other repeatable > fields. > It makes sense in this case to have a list of checkboxes instead of a > repeatable dropdown list, but I didn't expect that. So maybe the issue is > with the term "repeatable". I think that "multivalued" would fit better. > Is it feasible to change that term without too much work ? > Can anyone else from QA team or release team give their opinion on this ? > > Failing QA for 1 and 2 Thank you very much for your time here, Julian. I believe my 3 latest QA follow-up patches address 1) and 2). Please let me know if you disagree. As for 3) I agree with you, but don't feel strongly either way. I adopted the 'repeatable' naming to be consistent with patron attribute types, even though the 'repeatable' in patron attribute types only works for text fields, not AV fields, with that not being clear from the UI. My long term goal for additional fields + borrower patron attributes is to eventually merge these 2 features (they're essentially the same thing, written twice). But I'm happy to follow-up with the renaming if required.
> I adopted the 'repeatable' naming to be consistent with patron attribute types Ok, so it's probably better to keep "repeatable" for consistency. Thanks for the followup patches. I'll try to review them later today.
About the '' value, I agree that it doesn't make much sense to keep them. But it's a change in behavior, and maybe someone out there uses these empty values in some way. If we decide to not keep the empty value we should at least advertise it in the release notes (and in the commit messages, but you already did that) And I think that the updatedatabase should remove these empty values Other things to fix: 1) add_additional_fields does not allow '0' as a value, so it's not possible to add this value in subscriptions batch edit (the only place where add_additional_fields is used) 2) There is a piece of code that does nothing in koha-tmpl/intranet-tmpl/prog/en/modules/admin/additional-fields.tt: $("#repeatable").prop('checked') == true It's not an "if" condition and it appears on the same line as the end of a block so I assume this must be a copy/paste mistake 3) In koha-tmpl/intranet-tmpl/prog/js/additional-fields-entry.js functions clone_entry and clear_entry are added to the global scope. To avoid that you should wrap the whole script inside a block like this: (function () { // code goes here })(); 4) QA script failure: FAIL installer/data/mysql/kohastructure.sql FAIL tinyint_has_boolean_flag The new column additional_fields.repeatable is using TINYINT(1) as type but is not defined as boolean in the schema file (Koha/Schema/Result/AdditionalField.pm), see the SQL12 coding guideline
Created attachment 169603 [details] [review] Bug 35044: (QA follow-up): Allow for '0' in serials batch edit This commit also ensures any existing '0' value additional fields are kept if batch editing and submitting the input empty
Created attachment 169604 [details] [review] Bug 35044: (QA follow-up): Remove useless code Most definitely a copy paste error. I've tested and retested this particular JS piece of code, works as intended before and after removing this badly copy pasted code. I'm surprised this wasn't causing a console error.
Created attachment 169605 [details] [review] Bug 35044: (QA follow-up): Avoid polluting the global scope with function using immediately invoked function expression
Created attachment 169606 [details] [review] Bug 35044: (QA follow-up): Fix QA script Error on boolean TINYINT
Created attachment 169607 [details] [review] Bug 35044: (QA follow-up): Add removal of empty value entries in additional_field_values to atomicupdate To test: 1) Follow any of the above test plans to add some additional_field_values entries 2) Run the following SQL: update additional_field_values set value = ''; 3) Run updatedatabase twice. Notice the first time it tells you how many entries were removed. The 2nd time it does nothing.
Created attachment 169643 [details] [review] Bug 35044: [DONT PUSH] dbic specific Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Julian Maurice <julian.maurice@biblibre.com> https://bugs.koha-community.org/show_bug.cgi?id=25044
Created attachment 169644 [details] [review] Bug 35044: DB changes + atomicupdate file Add the 'repeatable' column to additional_fields Remove the unique key from additional_field_values as we will now be allowing for repeated instances of the same field_id + record_id Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Julian Maurice <julian.maurice@biblibre.com> https://bugs.koha-community.org/show_bug.cgi?id=25044
Created attachment 169645 [details] [review] Bug 35044: Admin: New additional fields 'repeatable' field There is now a new 'repeatable' checkbox when configuring (adding or editing) an additional field for a specific table. It is also displayed in a column in the additional fields panel for a given tablename. MARC fields are not allowed to be repeatable. Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Julian Maurice <julian.maurice@biblibre.com> https://bugs.koha-community.org/show_bug.cgi?id=25044
Created attachment 169646 [details] [review] Bug 35044: Preparation: get_additional_field_values_for_template method New method to be utilized for retrieval of additional fields of any class that implements it. This is to be used when additional_fields are needed to be sent to .tt files for renderering. Both for form entries and read-only 'show' pages. Template files: Updated additional-fields-entry.inc: Now considers entry of repeatable fields. Repeatable text fields will have a "+New" link to allow for adding of a new instance of a repeatable field. Repeatable AV fields will be shown as checkboxes instead of a dropdown Update additional-fields-display.inc When displaying non-editable additional-fields, multiple instances for each field are now considered. Label now only shows if field has a non-null value in it. Option to show value_only Option to set if its to be displayed on a table cell Update histsearch.tt and filter-orders.inc Now calls additional-fields-entry.inc with search_form=1 to prevent repetable "+New" controls from showing on search inputs. additional-fields-entry.js New JS asset to be called by template files who require additional-fields-entry.inc for repeatable fields controls. This also handles the need for having the marcfield of type 'get' submitted if it is a disabled dropdown (AV marc field) Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Julian Maurice <julian.maurice@biblibre.com> https://bugs.koha-community.org/show_bug.cgi?id=25044
Created attachment 169647 [details] [review] Bug 35044: Update: Order baskets Test plan, k-t-d: Preparation: Create additional fields for table 'aqbasket': 2 text fields, one repeatable, one not-repeatable 2 AV fields, one repeatable, one not-repeatable 1) Add a new basket, visit: /cgi-bin/koha/acqui/basketheader.pl?booksellerid=1&op=add_form 2) Fill in name and all additional fields, click the '+New' and 'Clear' links, hit 'Save' 3) Notice the basket screen shows repeated fields separated by comma. 4) Notice that only non-null additional fields labels are shown. 5) Edit the basket. Notice all fields are shown as expected. Additional testing: Having a repeatable field with multiple instances, go back to the additional fields configuration and make the additional field non-repeatable again. Edit the basket again. Notice the multiple text instances are still shown, but the '+New' link no longer shows. You're able to remove existing multiple instances, but unable to add new ones, this is because the field is no longer repeatable. Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Julian Maurice <julian.maurice@biblibre.com> https://bugs.koha-community.org/show_bug.cgi?id=25044
Created attachment 169648 [details] [review] Bug 35044: Update: Acquisition orders Test plan, k-t-d: Preparation: Create additional fields for table 'aqorders': 2 text fields, one repeatable, one not-repeatable 2 AV fields, one repeatable, one not-repeatable 2 MARC fields, one 'get' and one 'set', both non-repeatable, MARC field 942$c Attempt to create a repeatable MARC field (get or set). Notice you're unable to. 1) Add a new order for an existing basket, with an existing record, visit: /cgi-bin/koha/acqui/neworderempty.pl?booksellerid=1&basketno=1&biblionumber=76 2) Set the mandatory "Koha item type" for the item. Click the 'Add item' button below. 3) Notice the accounting details now have quantity:1 4) Set the mandatory "Fund" input in accounting details. 5) At the bottom, fill in all additional fields, click the '+New' and 'Clear' links, hit 'Save' 6) In the orders table shown, click "Modify". Notice all the fields are presented correctly in the edit form. Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Julian Maurice <julian.maurice@biblibre.com> https://bugs.koha-community.org/show_bug.cgi?id=25044
Created attachment 169649 [details] [review] Bug 35044: Update: Invoices Added fixme comment to invoices.tt, the search works so nothing to do here, but the code is not DRY Test plan, k-t-d: Preparation: Create additional fields for table 'aqinvoices': 2 text fields, one repeatable, one not-repeatable 2 AV fields, one repeatable, one not-repeatable 1) Add a new invoice for an existing vendor, visit: /cgi-bin/koha/acqui/parcels.pl?booksellerid=1 2) Input something in the mandatory "Vendor invoice" field. 3) Fill in all additional fields, click the '+New' and 'Clear' links, hit 'Save' 4) Search for invoices, visit: http://localhost:8081/cgi-bin/koha/acqui/invoices.pl 5) Click "Search" on the left column of the page 6) Click the invoice we just created. Verify all the fields show correctly. 7) Go back to the additional fields configuration, set all additional fields as "searchable" 8) Return to http://localhost:8081/cgi-bin/koha/acqui/invoices.pl 9) Perform some searches using the additional fields values. Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Julian Maurice <julian.maurice@biblibre.com> https://bugs.koha-community.org/show_bug.cgi?id=25044
Created attachment 169650 [details] [review] Bug 35044: Update: Serial subscriptions Test plan, k-t-d: Preparation: Create additional fields for table 'subscription', visit: /cgi-bin/koha/admin/additional-fields.pl?tablename=subscription 2 text fields, one repeatable, one not-repeatable 2 AV fields, one repeatable, one not-repeatable 2 MARC fields, one 'get' and one 'set', both non-repeatable, MARC field 942$c Attempt to create a repeatable MARC field (get or set). Notice you're unable to. 1) Add a new serial subscription, visit: /cgi-bin/koha/serials/subscription-add.pl 2) Set the mandatory "Record" input (e.g. '112'). Click the 'Next' and press 'Ok' on the alert box. 3) Fill in all required fields and press "Test prediction pattern" 4) At the bottom, fill in all additional fields, click the '+New' and 'Clear' links, hit 'Save' 5) Notice the fields are shown, repeated fields are comma separated 6) Click Edit -> Edit Subscription, repeat steps 4 and 5 7) Go back to subscription additional fields, set all fields as searchable 8) Visit serials-home: /cgi-bin/koha/serials/serials-home.pl 9) Click 'Search' 10) Notice the searchable fields now show in their columns, repeated fields separated by comma 11) Perform a search using a repeatable field, verify it all works as expected. -- Subscription Claims -- Preparation: 1) Define a new claim notice, visit: /cgi-bin/koha/tools/letter.pl?op=add_form&module=claimissues 2) Input code, name, click "Email" set a "Message subject" and put something in the message body. Hit 'Save'. 3) Set a serial as late, visit our original subscription: /cgi-bin/koha/serials/serials-collection.pl?subscriptionid=1 4) Click "Edit serials" and status -> "Late". Hit "Save". 5) Link the original subscription to the existing vendor, visit: /cgi-bin/koha/serials/subscription-add.pl?op=modify&subscriptionid=1 6) Click "Search for a vendor". Hit "Ok". Hit "Choose". Save the subscription. Claims: 7) Visit claims: /cgi-bin/koha/serials/claims.pl 8) Click "Ok" 9) Verify that searchable additional fields all have their respective column. Repeated fields are shown comma separated. Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Julian Maurice <julian.maurice@biblibre.com> https://bugs.koha-community.org/show_bug.cgi?id=25044
Created attachment 169651 [details] [review] Bug 35044: Update: Serial subscriptions batch edit Test plan, k-t-d: Preparation: Create additional fields for table 'subscription', visit: /cgi-bin/koha/admin/additional-fields.pl?tablename=subscription 2 text fields, one repeatable, one not-repeatable 2 AV fields, one repeatable, one not-repeatable 2 MARC fields, one 'get' and one 'set', both non-repeatable, MARC field 942$c Attempt to create a repeatable MARC field (get or set). Notice you're unable to. 1) Add a new serial subscription, visit: /cgi-bin/koha/serials/subscription-add.pl 2) Set the mandatory "Record" input (e.g. '112'). Click the 'Next' and press 'Ok' on the alert box. 3) Fill in all required fields and press "Test prediction pattern" 4) At the bottom, fill in all additional fields, click the '+New' and 'Clear' links, hit 'Save' 5) Notice the fields are shown, repeated fields are comma separated 6) Repeat steps 1-4 to create a second subscription 7) Visit serials home and hit "Search": /cgi-bin/koha/serials/serials-home.pl 8) Check the checkboxes next to the 2 subscriptions and click "Edit selected serials" 9) Input some values in the additional fields section, click the '+New' and 'Clear' links, hit 'Save' 10) Verify that both subscriptions now have the new values form the batch edit. Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Julian Maurice <julian.maurice@biblibre.com> https://bugs.koha-community.org/show_bug.cgi?id=25044
Created attachment 169652 [details] [review] Bug 35044: Update: Manual invoices, manual credits and accountlines Test plan, k-t-d: Preparation: Create additional fields for table 'accountlines:credit', visit: /cgi-bin/koha/admin/additional-fields.pl?tablename=accountlines%3Acredit 2 text fields, one repeatable, one not-repeatable 2 AV fields, one repeatable, one not-repeatable 1) Add a new manual credit for admin borrower: /cgi-bin/koha/members/mancredit.pl?borrowernumber=51 2) Set the mandatory "Amount" input (e.g. '5'). Click the 'Next' and press 'Ok' on the alert box. 3) Fill in all additional fields, click the '+New' and 'Clear' links, hit 'Save' 4) On the table, click "Details" for the for account line we just created. 5) Notice the additional fields are there, repeated fields are comma separated. 6) Repeat the above test plan, but for accountlines:debit instead, visit: /cgi-bin/koha/admin/additional-fields.pl?tablename=accountlines%3Adebit 7) To add a manual invoice, visit: /cgi-bin/koha/members/maninvoice.pl?borrowernumber=51 Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Julian Maurice <julian.maurice@biblibre.com> https://bugs.koha-community.org/show_bug.cgi?id=25044
Created attachment 169653 [details] [review] Bug 35044: Add repetable to REST API spec Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Julian Maurice <julian.maurice@biblibre.com> https://bugs.koha-community.org/show_bug.cgi?id=25044
Created attachment 169654 [details] [review] Bug 35044: Add tests Test plan: prove t/db_dependent/Koha/Object/Mixin/AdditionalFields.t Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Julian Maurice <julian.maurice@biblibre.com> https://bugs.koha-community.org/show_bug.cgi?id=25044
Created attachment 169655 [details] [review] Bug 35044: (QA follow-up): DRY code before set_additional_fields Signed-off-by: Julian Maurice <julian.maurice@biblibre.com> https://bugs.koha-community.org/show_bug.cgi?id=25044
Created attachment 169656 [details] [review] Bug 35044: (QA follow-up): Allow for value '0' in additional fields This now allows for value '0' for an additional field (repeatable or not). This still does not allow for an empty '' field in additional fields. This is consistent with borrower patron attributes, i.e. if you submit an empty borrower patron attribute entry, it does not store it as empty. Additionally, if you have a value in a borrower patron attribute but then submit the form with that field as empty, it gets deleted from the database. I agree not being able to save the value '0' is a blocker, but not the empty. For consistency sake I'm keeping this as is, I don't see a use-case where a row with an empty field value is preferred over it not existing. If we allow for '' values of additional fields, the 'clear' button for repeatable fields would have to remove the input instead of clearing the value (or else how would the user remove repeatable fields entries?). If this is done, it's inconsistent with the repeatable fields from patron attribute types, as in that instance the 'clear' button only removes the input contents, not the input element itself. prove t/db_dependent/Koha/Object/Mixin/AdditionalFields.t Signed-off-by: Julian Maurice <julian.maurice@biblibre.com> https://bugs.koha-community.org/show_bug.cgi?id=25044
Created attachment 169657 [details] [review] Bug 35044: (QA follow-up): Remove FIXME and redundant code prove t/db_dependent/Koha/Acquisition/Booksellers.t prove t/db_dependent/Serials.t Signed-off-by: Julian Maurice <julian.maurice@biblibre.com> https://bugs.koha-community.org/show_bug.cgi?id=25044
Created attachment 169658 [details] [review] Bug 35044: (QA follow-up): Allow for '0' in serials batch edit This commit also ensures any existing '0' value additional fields are kept if batch editing and submitting the input empty Signed-off-by: Julian Maurice <julian.maurice@biblibre.com> https://bugs.koha-community.org/show_bug.cgi?id=25044
Created attachment 169659 [details] [review] Bug 35044: (QA follow-up): Remove useless code Most definitely a copy paste error. I've tested and retested this particular JS piece of code, works as intended before and after removing this badly copy pasted code. I'm surprised this wasn't causing a console error. Signed-off-by: Julian Maurice <julian.maurice@biblibre.com> https://bugs.koha-community.org/show_bug.cgi?id=25044
Created attachment 169660 [details] [review] Bug 35044: (QA follow-up): Avoid polluting global scope with functions using immediately invoked function expression Signed-off-by: Julian Maurice <julian.maurice@biblibre.com> https://bugs.koha-community.org/show_bug.cgi?id=25044
Created attachment 169661 [details] [review] Bug 35044: (QA follow-up): Fix QA script Error on boolean TINYINT Signed-off-by: Julian Maurice <julian.maurice@biblibre.com> https://bugs.koha-community.org/show_bug.cgi?id=25044
Created attachment 169662 [details] [review] Bug 35044: (QA follow-up): Remove empty additional_field_values entries To test: 1) Follow any of the above test plans to add some additional_field_values entries 2) Run the following SQL: update additional_field_values set value = ''; 3) Run updatedatabase twice. Notice the first time it tells you how many entries were removed. The 2nd time it does nothing. Signed-off-by: Julian Maurice <julian.maurice@biblibre.com> https://bugs.koha-community.org/show_bug.cgi?id=25044
Created attachment 169663 [details] [review] Bug 35044: (QA follow-up) Delete empty values with a single query Signed-off-by: Julian Maurice <julian.maurice@biblibre.com> https://bugs.koha-community.org/show_bug.cgi?id=25044
Created attachment 169664 [details] [review] Bug 35044: [DONT PUSH] dbic specific Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Created attachment 169665 [details] [review] Bug 35044: DB changes + atomicupdate file Add the 'repeatable' column to additional_fields Remove the unique key from additional_field_values as we will now be allowing for repeated instances of the same field_id + record_id Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Created attachment 169666 [details] [review] Bug 35044: Admin: New additional fields 'repeatable' field There is now a new 'repeatable' checkbox when configuring (adding or editing) an additional field for a specific table. It is also displayed in a column in the additional fields panel for a given tablename. MARC fields are not allowed to be repeatable. Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Created attachment 169667 [details] [review] Bug 35044: Preparation: get_additional_field_values_for_template method New method to be utilized for retrieval of additional fields of any class that implements it. This is to be used when additional_fields are needed to be sent to .tt files for renderering. Both for form entries and read-only 'show' pages. Template files: Updated additional-fields-entry.inc: Now considers entry of repeatable fields. Repeatable text fields will have a "+New" link to allow for adding of a new instance of a repeatable field. Repeatable AV fields will be shown as checkboxes instead of a dropdown Update additional-fields-display.inc When displaying non-editable additional-fields, multiple instances for each field are now considered. Label now only shows if field has a non-null value in it. Option to show value_only Option to set if its to be displayed on a table cell Update histsearch.tt and filter-orders.inc Now calls additional-fields-entry.inc with search_form=1 to prevent repetable "+New" controls from showing on search inputs. additional-fields-entry.js New JS asset to be called by template files who require additional-fields-entry.inc for repeatable fields controls. This also handles the need for having the marcfield of type 'get' submitted if it is a disabled dropdown (AV marc field) Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Created attachment 169668 [details] [review] Bug 35044: Update: Order baskets Test plan, k-t-d: Preparation: Create additional fields for table 'aqbasket': 2 text fields, one repeatable, one not-repeatable 2 AV fields, one repeatable, one not-repeatable 1) Add a new basket, visit: /cgi-bin/koha/acqui/basketheader.pl?booksellerid=1&op=add_form 2) Fill in name and all additional fields, click the '+New' and 'Clear' links, hit 'Save' 3) Notice the basket screen shows repeated fields separated by comma. 4) Notice that only non-null additional fields labels are shown. 5) Edit the basket. Notice all fields are shown as expected. Additional testing: Having a repeatable field with multiple instances, go back to the additional fields configuration and make the additional field non-repeatable again. Edit the basket again. Notice the multiple text instances are still shown, but the '+New' link no longer shows. You're able to remove existing multiple instances, but unable to add new ones, this is because the field is no longer repeatable. Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Created attachment 169669 [details] [review] Bug 35044: Update: Acquisition orders Test plan, k-t-d: Preparation: Create additional fields for table 'aqorders': 2 text fields, one repeatable, one not-repeatable 2 AV fields, one repeatable, one not-repeatable 2 MARC fields, one 'get' and one 'set', both non-repeatable, MARC field 942$c Attempt to create a repeatable MARC field (get or set). Notice you're unable to. 1) Add a new order for an existing basket, with an existing record, visit: /cgi-bin/koha/acqui/neworderempty.pl?booksellerid=1&basketno=1&biblionumber=76 2) Set the mandatory "Koha item type" for the item. Click the 'Add item' button below. 3) Notice the accounting details now have quantity:1 4) Set the mandatory "Fund" input in accounting details. 5) At the bottom, fill in all additional fields, click the '+New' and 'Clear' links, hit 'Save' 6) In the orders table shown, click "Modify". Notice all the fields are presented correctly in the edit form. Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Created attachment 169670 [details] [review] Bug 35044: Update: Invoices Added fixme comment to invoices.tt, the search works so nothing to do here, but the code is not DRY Test plan, k-t-d: Preparation: Create additional fields for table 'aqinvoices': 2 text fields, one repeatable, one not-repeatable 2 AV fields, one repeatable, one not-repeatable 1) Add a new invoice for an existing vendor, visit: /cgi-bin/koha/acqui/parcels.pl?booksellerid=1 2) Input something in the mandatory "Vendor invoice" field. 3) Fill in all additional fields, click the '+New' and 'Clear' links, hit 'Save' 4) Search for invoices, visit: http://localhost:8081/cgi-bin/koha/acqui/invoices.pl 5) Click "Search" on the left column of the page 6) Click the invoice we just created. Verify all the fields show correctly. 7) Go back to the additional fields configuration, set all additional fields as "searchable" 8) Return to http://localhost:8081/cgi-bin/koha/acqui/invoices.pl 9) Perform some searches using the additional fields values. Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Created attachment 169671 [details] [review] Bug 35044: Update: Serial subscriptions Test plan, k-t-d: Preparation: Create additional fields for table 'subscription', visit: /cgi-bin/koha/admin/additional-fields.pl?tablename=subscription 2 text fields, one repeatable, one not-repeatable 2 AV fields, one repeatable, one not-repeatable 2 MARC fields, one 'get' and one 'set', both non-repeatable, MARC field 942$c Attempt to create a repeatable MARC field (get or set). Notice you're unable to. 1) Add a new serial subscription, visit: /cgi-bin/koha/serials/subscription-add.pl 2) Set the mandatory "Record" input (e.g. '112'). Click the 'Next' and press 'Ok' on the alert box. 3) Fill in all required fields and press "Test prediction pattern" 4) At the bottom, fill in all additional fields, click the '+New' and 'Clear' links, hit 'Save' 5) Notice the fields are shown, repeated fields are comma separated 6) Click Edit -> Edit Subscription, repeat steps 4 and 5 7) Go back to subscription additional fields, set all fields as searchable 8) Visit serials-home: /cgi-bin/koha/serials/serials-home.pl 9) Click 'Search' 10) Notice the searchable fields now show in their columns, repeated fields separated by comma 11) Perform a search using a repeatable field, verify it all works as expected. -- Subscription Claims -- Preparation: 1) Define a new claim notice, visit: /cgi-bin/koha/tools/letter.pl?op=add_form&module=claimissues 2) Input code, name, click "Email" set a "Message subject" and put something in the message body. Hit 'Save'. 3) Set a serial as late, visit our original subscription: /cgi-bin/koha/serials/serials-collection.pl?subscriptionid=1 4) Click "Edit serials" and status -> "Late". Hit "Save". 5) Link the original subscription to the existing vendor, visit: /cgi-bin/koha/serials/subscription-add.pl?op=modify&subscriptionid=1 6) Click "Search for a vendor". Hit "Ok". Hit "Choose". Save the subscription. Claims: 7) Visit claims: /cgi-bin/koha/serials/claims.pl 8) Click "Ok" 9) Verify that searchable additional fields all have their respective column. Repeated fields are shown comma separated. Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Created attachment 169672 [details] [review] Bug 35044: Update: Serial subscriptions batch edit Test plan, k-t-d: Preparation: Create additional fields for table 'subscription', visit: /cgi-bin/koha/admin/additional-fields.pl?tablename=subscription 2 text fields, one repeatable, one not-repeatable 2 AV fields, one repeatable, one not-repeatable 2 MARC fields, one 'get' and one 'set', both non-repeatable, MARC field 942$c Attempt to create a repeatable MARC field (get or set). Notice you're unable to. 1) Add a new serial subscription, visit: /cgi-bin/koha/serials/subscription-add.pl 2) Set the mandatory "Record" input (e.g. '112'). Click the 'Next' and press 'Ok' on the alert box. 3) Fill in all required fields and press "Test prediction pattern" 4) At the bottom, fill in all additional fields, click the '+New' and 'Clear' links, hit 'Save' 5) Notice the fields are shown, repeated fields are comma separated 6) Repeat steps 1-4 to create a second subscription 7) Visit serials home and hit "Search": /cgi-bin/koha/serials/serials-home.pl 8) Check the checkboxes next to the 2 subscriptions and click "Edit selected serials" 9) Input some values in the additional fields section, click the '+New' and 'Clear' links, hit 'Save' 10) Verify that both subscriptions now have the new values form the batch edit. Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Created attachment 169673 [details] [review] Bug 35044: Update: Manual invoices, manual credits and accountlines Test plan, k-t-d: Preparation: Create additional fields for table 'accountlines:credit', visit: /cgi-bin/koha/admin/additional-fields.pl?tablename=accountlines%3Acredit 2 text fields, one repeatable, one not-repeatable 2 AV fields, one repeatable, one not-repeatable 1) Add a new manual credit for admin borrower: /cgi-bin/koha/members/mancredit.pl?borrowernumber=51 2) Set the mandatory "Amount" input (e.g. '5'). Click the 'Next' and press 'Ok' on the alert box. 3) Fill in all additional fields, click the '+New' and 'Clear' links, hit 'Save' 4) On the table, click "Details" for the for account line we just created. 5) Notice the additional fields are there, repeated fields are comma separated. 6) Repeat the above test plan, but for accountlines:debit instead, visit: /cgi-bin/koha/admin/additional-fields.pl?tablename=accountlines%3Adebit 7) To add a manual invoice, visit: /cgi-bin/koha/members/maninvoice.pl?borrowernumber=51 Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Created attachment 169674 [details] [review] Bug 35044: Add repetable to REST API spec Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Created attachment 169675 [details] [review] Bug 35044: Add tests Test plan: prove t/db_dependent/Koha/Object/Mixin/AdditionalFields.t Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Created attachment 169676 [details] [review] Bug 35044: (QA follow-up): DRY code before set_additional_fields Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Created attachment 169677 [details] [review] Bug 35044: (QA follow-up): Allow for value '0' in additional fields This now allows for value '0' for an additional field (repeatable or not). This still does not allow for an empty '' field in additional fields. This is consistent with borrower patron attributes, i.e. if you submit an empty borrower patron attribute entry, it does not store it as empty. Additionally, if you have a value in a borrower patron attribute but then submit the form with that field as empty, it gets deleted from the database. I agree not being able to save the value '0' is a blocker, but not the empty. For consistency sake I'm keeping this as is, I don't see a use-case where a row with an empty field value is preferred over it not existing. If we allow for '' values of additional fields, the 'clear' button for repeatable fields would have to remove the input instead of clearing the value (or else how would the user remove repeatable fields entries?). If this is done, it's inconsistent with the repeatable fields from patron attribute types, as in that instance the 'clear' button only removes the input contents, not the input element itself. prove t/db_dependent/Koha/Object/Mixin/AdditionalFields.t Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Created attachment 169678 [details] [review] Bug 35044: (QA follow-up): Remove FIXME and redundant code prove t/db_dependent/Koha/Acquisition/Booksellers.t prove t/db_dependent/Serials.t Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Created attachment 169679 [details] [review] Bug 35044: (QA follow-up): Allow for '0' in serials batch edit This commit also ensures any existing '0' value additional fields are kept if batch editing and submitting the input empty Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Created attachment 169680 [details] [review] Bug 35044: (QA follow-up): Remove useless code Most definitely a copy paste error. I've tested and retested this particular JS piece of code, works as intended before and after removing this badly copy pasted code. I'm surprised this wasn't causing a console error. Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Created attachment 169681 [details] [review] Bug 35044: (QA follow-up): Avoid polluting global scope with functions using immediately invoked function expression Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Created attachment 169682 [details] [review] Bug 35044: (QA follow-up): Fix QA script Error on boolean TINYINT Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Created attachment 169683 [details] [review] Bug 35044: (QA follow-up): Remove empty additional_field_values entries To test: 1) Follow any of the above test plans to add some additional_field_values entries 2) Run the following SQL: update additional_field_values set value = ''; 3) Run updatedatabase twice. Notice the first time it tells you how many entries were removed. The 2nd time it does nothing. Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Created attachment 169684 [details] [review] Bug 35044: (QA follow-up) Delete empty values with a single query Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
I added the last patch and edited some of the commit messages to make them fit into the 72-column width limit. Everything works fine, code looks good and QA script is happy => PQA
Created attachment 169697 [details] [review] Bug 35044: (QA follow-up): Fix flaky tests To test, run the following test file a couple times until it fails: prove t/db_dependent/Koha/Object/Mixin/AdditionalFields.t My testing this failed around 50% of the time so it should not take long to reproduce. I believe this is because the order of the array elements may differ. Apply this patch and run the test file again many times. It should never fail.
There appears to be some mistake in the database update, but I fail to spot it: {UNKNOWN}: DBIx::Class::ResultSource::column_info(): No such column repeatable at /kohadevbox/koha/Koha/Schema/Result/AdditionalField.pm line 159 Compilation failed in require at /usr/share/perl5/Class/C3/Componentised.pm line 146. at /usr/share/perl5/Class/C3/Componentised.pm line 151 Compilation failed in require at /kohadevbox/koha/C4/Installer.pm line 30. BEGIN failed--compilation aborted at /kohadevbox/koha/C4/Installer.pm line 30. Compilation failed in require at /kohadevbox/koha/installer/data/mysql/updatedatabase.pl line 40. BEGIN failed--compilation aborted at /kohadevbox/koha/installer/data/mysql/updatedatabase.pl line 40. Applied all patches, removed the "DO NOT PUSH" patch. Please add use of say_success to database update when working on the follow-up.
Created attachment 170501 [details] [review] Bug 35044: (QA follow-up): Add color to atomic update
(In reply to Katrin Fischer from comment #139) > Applied all patches, removed the "DO NOT PUSH" patch. Did you run dbic? You need the patch or run dbic since those are the schema files. IF that's not it, where/when does the error show up?
(In reply to Pedro Amorim from comment #141) > (In reply to Katrin Fischer from comment #139) > > Applied all patches, removed the "DO NOT PUSH" patch. > Did you run dbic? You need the patch or run dbic since those are the schema > files. > IF that's not it, where/when does the error show up? I wanted to run dbic after updating the database - otherwise it can't show me the new field.
(In reply to Katrin Fischer from comment #139) > There appears to be some mistake in the database update, but I fail to spot > it: > > {UNKNOWN}: DBIx::Class::ResultSource::column_info(): No such column > repeatable at /kohadevbox/koha/Koha/Schema/Result/AdditionalField.pm line 159 > Compilation failed in require at /usr/share/perl5/Class/C3/Componentised.pm > line 146. at /usr/share/perl5/Class/C3/Componentised.pm line 151 > Compilation failed in require at /kohadevbox/koha/C4/Installer.pm line 30. > BEGIN failed--compilation aborted at /kohadevbox/koha/C4/Installer.pm line > 30. > Compilation failed in require at > /kohadevbox/koha/installer/data/mysql/updatedatabase.pl line 40. > BEGIN failed--compilation aborted at > /kohadevbox/koha/installer/data/mysql/updatedatabase.pl line 40. > > Applied all patches, removed the "DO NOT PUSH" patch. > > Please add use of say_success to database update when working on the > follow-up. The error appears when running updatedatabase.
You need to also not apply the patch: Bug 35044: (QA follow-up): Fix QA script Error on boolean TINYINT Because that is fixing the TINYIT boolean database thing for 'repeatable', but if you don't run dbic or apply the schema patch, then the 'repeatable' field does not exist on the schema class.
(In reply to Pedro Amorim from comment #144) > You need to also not apply the patch: > Bug 35044: (QA follow-up): Fix QA script Error on boolean TINYINT > > Because that is fixing the TINYIT boolean database thing for 'repeatable', > but if you don't run dbic or apply the schema patch, then the 'repeatable' > field does not exist on the schema class. Huh. I guess on update for others this would work well because the dbic files will already be installed? So what I'll do: * Apply all patches * Run database update * Remove dbic patch * Re-run dbic and commit it
Please let me know if something else is a blocker here.
Hm, some untidiness added by this patch set... I tidied the database update, but leaving the others for now.
Pushed for 24.11! Well done everyone, thank you!
No backport for 24.05.x
There is a logic error in additional-fields-entry.inc 15 [% IF field.marcfield && field.marcfield_mode == 'get' %] 16 <select name="additional_field_[% field.id | html %]" id="additional_field_[% field.id | html %]" class="marcfieldget" disabled> 17 [% ELSE %] 18 [% IF !field.repeatable %] 19 <select name="additional_field_[% field.id | html %]" id="additional_field_[% field.id | html %]"> 20 [% END %] 21 [% END %] Then later we unconditionally close 79 </select> Can you have a look please?
(In reply to Jonathan Druart from comment #150) > There is a logic error in additional-fields-entry.inc > > 15 [% IF field.marcfield && field.marcfield_mode == 'get' %] > 16 <select name="additional_field_[% field.id | html > %]" id="additional_field_[% field.id | html %]" class="marcfieldget" > disabled> > 17 [% ELSE %] > 18 [% IF !field.repeatable %] > 19 <select name="additional_field_[% field.id | > html %]" id="additional_field_[% field.id | html %]"> > 20 [% END %] > 21 [% END %] > > Then later we unconditionally close > 79 </select> > > Can you have a look please? Opened bug 38738