Bug 13399 - Select a department: empty field if no description set in authorized value
Summary: Select a department: empty field if no description set in authorized value
Status: RESOLVED WONTFIX
Alias: None
Product: Koha
Classification: Unclassified
Component: Course reserves (show other bugs)
Version: master
Hardware: All All
: P5 - low minor (vote)
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-12-05 09:27 UTC by Mirko Tietgen
Modified: 2023-07-28 19:56 UTC (History)
5 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Proposed Patch (1.68 KB, patch)
2015-02-28 03:46 UTC, Tom Misilo
Details | Diff | Splinter Review
Add check to determine if d.lib exists (1.71 KB, patch)
2015-04-06 22:49 UTC, Mark Tompsett
Details | Diff | Splinter Review
Bug 13399: Missing validation on authorised value descriptions (7.01 KB, patch)
2015-04-14 01:21 UTC, Mark Tompsett
Details | Diff | Splinter Review
Bug 13399: Missing validation on authorised value descriptions (8.79 KB, patch)
2015-04-14 01:51 UTC, Mark Tompsett
Details | Diff | Splinter Review
Bug 13399: Missing validation on authorised value descriptions (8.76 KB, patch)
2015-04-14 02:00 UTC, Mark Tompsett
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Mirko Tietgen 2014-12-05 09:27:58 UTC
When you set up an authorized value in the DEPARTMENT category without descriptions, the pull down menu in course creation shows an empty value. It should instead fall back to the name of the authorized value.

1. Set up an authorized value in the DEPARTMENT category. Leave description fields empty.
2. Go to Course reserves, Create course.
3. Open the »Select a department« pull down menu, observe that there is no description

Expected: display the name of the authorized value if no description is given.
Comment 1 Tom Misilo 2015-02-28 03:46:59 UTC Comment hidden (obsolete)
Comment 2 Marc Véron 2015-03-16 15:15:17 UTC
Sorry, patch does not apply:

git bz apply 13399

36242 - Proposed Patch

Applying: Add check to determine if d.lib exists
fatal: corrupt patch at line 20
Repository lacks necessary blobs to fall back on 3-way merge.
Cannot fall back to three-way merge.
Patch failed at 0001 Add check to determine if d.lib exists
Comment 3 Mark Tompsett 2015-04-06 22:49:00 UTC Comment hidden (obsolete)
Comment 4 Mark Tompsett 2015-04-06 22:50:18 UTC
Rescued Tom's patch. It looks good.
Comment 5 Tom Misilo 2015-04-06 22:54:21 UTC
Thanks for fixing the patch!
Comment 6 Jonathan Druart 2015-04-13 13:37:11 UTC
This does not work, it's not filled with the value everywhere it is displayed.
It should be fixed on a higher level, for all authorised values I think (C4::Koha::GetAuthorisedValues and some others).
Or maybe the best way would be to make the description mandatory on the AV administration page.
Comment 7 Mark Tompsett 2015-04-13 14:36:45 UTC
(In reply to Jonathan Druart from comment #6)
> Or maybe the best way would be to make the description mandatory on the AV
> administration page.

I think this is a better solution, yes.
Comment 8 Mark Tompsett 2015-04-14 01:21:27 UTC Comment hidden (obsolete)
Comment 9 Mark Tompsett 2015-04-14 01:51:50 UTC Comment hidden (obsolete)
Comment 10 Mark Tompsett 2015-04-14 02:00:25 UTC
Created attachment 37785 [details] [review]
Bug 13399: Missing validation on authorised value descriptions

This adds validations which force both the OPAC and Staff Client
authorized value descriptions to be filled in.

TEST PLAN
---------
1) Login to staff client
2) Koha administration -> Authorized values
3) Change drop-down to 'DEPARTMENT'
   -- Assuming you have default values installed,
      and DEPARTMENT exists.
4) Click '+ New authorized value for DEPARTMENT'
5) Enter a 'Authorized value:' and click 'Save'
   -- This will create it without OPAC and Staff Client
      descriptions! This is wrong.
6) Apply patch
7) $ ./installer/data/mysql/updatedatabase.pl
   -- expecting atomic update to run.
8) Refresh staff client page
   -- the descriptions should now be filled in.
9) Repeat steps 4 and 5
   -- This time, you will be given two error messages
   -- Nothing will be created.
10) Attempt to create a new authorized value with descriptions.
    -- should save without issue.
11) Run koha qa test tools
    -- SQL files are unchecked, but steps 7 & 8 confirm validity.
    -- Should be no issues.
Comment 11 Katrin Fischer 2015-04-14 05:34:41 UTC
I don't think this is the correct solution. There are reasons why it makes sometimes sense to leave one or both descriptions empty. In the past Koha even came with 0 values that had empty descriptions to offer an empty entry in some pull down lists. Also, if you leave the OPAC description empty it will fall back to the library description as a feature.
Comment 12 Katrin Fischer 2015-04-14 05:37:37 UTC
And is this really a bug? What if a library just doesn't want to display anything in department and term?
Comment 13 Mark Tompsett 2015-04-14 12:23:23 UTC
(In reply to Katrin Fischer from comment #12)
> And is this really a bug? What if a library just doesn't want to display
> anything in department and term?

Then they wouldn't have entered any authorized values, right?
Blanks in dropdowns shouldn't be forced data-entries. They should be added to the dropdowns.
Comment 14 Mark Tompsett 2015-04-14 12:25:07 UTC
(In reply to Katrin Fischer from comment #11)
> In the past Koha
> even came with 0 values that had empty descriptions to offer an empty entry
> in some pull down lists.

Can you provide a suggestion where to look in the user interface for these types of drop-downs that may require blanks?
Comment 15 Katrin Fischer 2015-04-14 13:31:46 UTC
Mark, Term and Department are mandatory in the course reserves module - the library is forced to enter an authorized value.

Asked the other way around: what negative side effect does it have to not enforce entering a subscription?
Comment 16 Katrin Fischer 2023-07-28 19:56:25 UTC
7 years later, I still believe this not to be a bug. Please reopen to restart discussion if you disagree.