Koha/C4
Katrin Fischer 6f3c1d5af8
Bug 21927: Acq - Add blank values in pull downs of mandatory item subfields
This is the same fix as on bug 14662, which fixed the behaviour in
cataloguing, but for the item form in acquisitions.

The code assumes that if a subfield is marked as mandatory, there
should be no empty entry in the pull downs.

This assumption is not correct, as it leads to the first entry of the
pull down being preselected if there is no default set. As the field
can never be 'unset', there will never be a 'required' warning.
Furthermore, it might be counterproductive to use mandatory fields,
as it might be easily forgotten to change the preselected value and
those mistakes will be hard to find.

Correct behaviour would be to preselect the empty value when there is
no default. This means on saving the item an error message is triggered
and the cataloger is forced to set the value.

To test:
- This is best tested with an ACQ framework, but default can be used
  when no ACQ framework was created.
- In your MARC bibliographic framework:
  - In 952 make itemtype, classification source and some other pull downs
    like location or collection mandatory and set them to visibel if needed
- Create a new basket with 'items created while ordering'
- Add a new order, an existing record with 942$c set will work best
- Add items for your order line
  - Verify that the first value of each pull down is preselected,
    there is no way to trigger the 'required' error
- Apply patch
  - Add a new order line
    - Verify that classification source is preselected according to the
      DefaultClassificationSource system preference (try unsetting it later)
    - Verify all mandatory fields can be set to empty
    - Verify that you can't save before correctly setting them
  - Change your frameworks and set a default for itemtype (Ex: BK) and
    another mandatory and non-mandatory field of your choice
  - Add a new order line and item and verify the defaults are selected

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2020-04-27 11:14:58 +01:00
..
AuthoritiesMarc Bug 24217: use Modern::Perl for modules when strict is missing 2020-01-03 10:45:46 +00:00
Barcodes
ClassSortRoutine
ClassSplitRoutine
Creators Bug 24545: Fix license statements 2020-02-24 13:31:26 +00:00
External
Form
Heading Bug 24269: Adjust C4::Heading to generate headings from auth tags 2020-02-19 13:33:32 +00:00
ILSDI Bug 20443: (follow-up) Move GetBorrowerAttributes to Koha::Patron - ILSDI 2020-03-23 13:49:22 +00:00
Installer Bug 24545: Fix license statements 2020-02-24 13:31:26 +00:00
Labels Bug 23514: Split Call Numbers for all layout types 2020-04-14 07:59:11 +01:00
Linker Bug 24269: Adjust C4::Heading to generate headings from auth tags 2020-02-19 13:33:32 +00:00
Members Bug 20443: Remove extended_attributes_code_value_arrayref AND C4::Members::Attributes 2020-03-23 13:49:22 +00:00
OAI Bug 23084: Replace grep {^$var$} with grep {$_ eq $var} 2020-02-17 10:44:45 +00:00
Output
Patroncards Bug 23488: Line wrapping doesn't always respect word order in Patron card creator 2020-03-02 09:49:57 +00:00
Reports Bug 22001: execute reports in an eval 2020-03-31 17:48:14 +01:00
Search Bug 24217: use Modern::Perl for modules when strict is missing 2020-01-03 10:45:46 +00:00
Serials
SIP Bug 20816: Add ability to define custom templated fields in SIP patron responses 2020-04-22 13:31:59 +01:00
Utils Bug 25142: Fix wrong grep logical test 2020-04-27 10:44:49 +01:00
Accounts.pm Bug 24217: use Modern::Perl for modules when strict is missing 2020-01-03 10:45:46 +00:00
Acquisition.pm Bug 20728: Remove the 2 GetLastOrder* subroutines 2020-04-14 16:39:12 +01:00
Auth.pm Bug 21190: (follow-up) Save patron id in failure when available 2020-04-14 16:13:39 +01:00
Auth_cas_servers.yaml.sample
Auth_with_cas.pm
Auth_with_ldap.pm Bug 20443: Use search_with_library_limits for attribute types 2020-03-23 13:49:22 +00:00
Auth_with_shibboleth.pm Bug 24199: (bug 23042 follow-up) Prevent t/Auth_with_shibboleth.t to fail randomly 2019-12-10 10:43:20 +00:00
AuthoritiesMarc.pm Bug 24735: Remove QueryParser-related code 2020-03-02 11:13:03 +00:00
BackgroundJob.pm Bug 24217: use Modern::Perl for modules when strict is missing 2020-01-03 10:45:46 +00:00
Barcodes.pm
Biblio.pm Bug 21901: Add FK on subscription and serial tables 2020-04-17 09:39:00 +01:00
Bookseller.pm Bug 24002: Incorrect DATE value: '' in C4/Bookseller.pm 2019-11-12 13:50:06 +00:00
Boolean.pm
Breeding.pm Bug 24052: Rename XSLT_Handler 2020-03-24 10:42:23 +00:00
Budgets.pm Bug 24361: (bug 24217 follow-up) Fix several warnings in C4 modules 2020-01-07 13:59:51 +00:00
Calendar.pm Bug 19475: Don't copy holiday if it already exists in target calendar 2020-04-03 14:26:33 +01:00
Charset.pm
Circulation.pm Bug 24380: (QA follow-up) Simplify condition 2020-04-15 12:28:54 +01:00
ClassSortRoutine.pm
ClassSource.pm
ClassSplitRoutine.pm
Context.pm Bug 25131: Add C4::Context->needs_install 2020-04-16 19:20:57 +01:00
Contract.pm Bug 24217: use Modern::Perl for modules when strict is missing 2020-01-03 10:45:46 +00:00
CourseReserves.pm Bug 23727: Editing course reserve items is broken 2020-04-17 13:45:56 +01:00
Creators.pm
Debug.pm
Heading.pm Bug 24269: Adjust C4::Heading to generate headings from auth tags 2020-02-19 13:33:32 +00:00
HoldsQueue.pm Bug 23934: Item level holds not checked for LocalHoldsPriority in Holds Queue 2020-01-10 16:19:40 +00:00
HTML5Media.pm
Images.pm Revert "Bug 21987: Do not generate true color thumbnails if not needed" 2019-11-04 13:21:53 +00:00
ImportBatch.pm Bug 23463: Remove DelItemCheck and ItemSafeToDelete 2020-03-23 09:26:31 +00:00
ImportExportFramework.pm
InstallAuth.pm Bug 4461: Adding user flags for managing OPAC problem reports 2020-04-06 11:18:13 +01:00
Installer.pm Bug 24883: Add POD entry and remove unused variable 2020-03-27 12:11:32 +00:00
ItemCirculationAlertPreference.pm
Items.pm Bug 21927: Acq - Add blank values in pull downs of mandatory item subfields 2020-04-27 11:14:58 +01:00
Koha.pm Bug 17845: Remove unused code related to printers 2020-03-10 15:18:27 +00:00
Labels.pm
Languages.pm Bug 20116: Cache language list 2020-04-17 09:24:23 +01:00
Letters.pm Bug 24840: Replace DateTime->now with dt_from_string 2020-04-08 11:54:23 +01:00
Linker.pm
Log.pm Bug 21190: Add interfaces parameter to POD in C4::Logs 2020-04-14 16:13:38 +01:00
MarcModificationTemplates.pm Bug 24840: Replace DateTime->now with dt_from_string 2020-04-08 11:54:23 +01:00
Matcher.pm Bug 24735: Remove QueryParser-related code 2020-03-02 11:13:03 +00:00
Members.pm Bug 20443: Remove SearchIdMatchingAttribute 2020-03-23 13:49:21 +00:00
Message.pm
NewsChannels.pm Bug 24002: Incorrect DATE value: '00-00-0000' in NewsChannels.pm 2019-11-12 13:49:58 +00:00
Output.pm Bug 24369: Add CORS support to output_with_http_headers() 2020-03-05 12:59:44 +00:00
Overdues.pm Bug 25123: Count the current fine when reducing for maxFine 2020-04-21 12:29:41 +01:00
Patroncards.pm
Record.pm Bug 24052: Rename XSLT_Handler 2020-03-24 10:42:23 +00:00
Reports.pm Bug 24217: use Modern::Perl for modules when strict is missing 2020-01-03 10:45:46 +00:00
Reserves.pm Bug 24620: Fix test, remove replaced code, use dt_from_string 2020-04-14 17:24:41 +01:00
Ris.pm
RotatingCollections.pm Bug 24299: Record 'RotatingCollection' as a transfer trigger 2020-03-20 15:54:55 +00:00
Scheduler.pm Bug 24217: use Modern::Perl for modules when strict is missing 2020-01-03 10:45:46 +00:00
Scrubber.pm
Search.pm Bug 19279: performance of linked items in search 2020-03-18 17:51:25 +00:00
Serials.pm Bug 21901: Add FK on subscription and serial tables 2020-04-17 09:39:00 +01:00
Service.pm
ShelfBrowser.pm
SMS.pm
SocialData.pm
Stats.pm Bug 23084: Replace grep {^$var$} with grep {$_ eq $var} 2020-02-17 10:44:45 +00:00
Suggestions.pm Bug 22784: Add the ability to archive/unarchive a purchase suggestions 2020-04-14 16:19:02 +01:00
Tags.pm Bug 23084: Replace grep {^$var$} with grep {$_ eq $var} 2020-02-17 10:44:45 +00:00
Templates.pm
TmplToken.pm
TmplTokenType.pm Bug 24217: use Modern::Perl for modules when strict is missing 2020-01-03 10:45:46 +00:00
TTParser.pm Bug 25257: Preserve prolog on translated XML files 2020-04-27 11:04:34 +01:00
UsageStats.pm Bug 25147: (RM follow-up) Update pref references. 2020-04-17 09:03:47 +01:00
XISBN.pm Bug 24217: use Modern::Perl for modules when strict is missing 2020-01-03 10:45:46 +00:00
XSLT.pm Bug 24052: Rename XSLT_Handler 2020-03-24 10:42:23 +00:00