Bug 10602 - Set a default value for authorities
Summary: Set a default value for authorities
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Cataloging (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Jonathan Druart
QA Contact: Testopia
URL:
Keywords:
: 4887 (view as bug list)
Depends on:
Blocks: 11286
  Show dependency treegraph
 
Reported: 2013-07-17 12:52 UTC by Jonathan Druart
Modified: 2014-12-07 20:07 UTC (History)
8 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
Bug 10602: Set a default value for authorities (8.38 KB, patch)
2013-07-17 12:53 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 10602: Set a default value for authorities (8.38 KB, patch)
2013-09-18 12:01 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 10602: Set a default value for authorities (8.43 KB, patch)
2013-09-29 04:37 UTC, Chris Cormack
Details | Diff | Splinter Review
Bug 10602: Set a default value for authorities (8.38 KB, patch)
2013-09-30 12:26 UTC, Jonathan Druart
Details | Diff | Splinter Review
[SIGNED-OFF] Bug 10602: Set a default value for authorities (8.62 KB, patch)
2013-09-30 15:28 UTC, Bernardo Gonzalez Kriegel
Details | Diff | Splinter Review
Bug 10602 - followup to remove tabs (2.40 KB, patch)
2013-09-30 15:29 UTC, Bernardo Gonzalez Kriegel
Details | Diff | Splinter Review
[PASSED QA] Bug 10602: Set a default value for authorities (9.23 KB, patch)
2013-09-30 17:53 UTC, Katrin Fischer
Details | Diff | Splinter Review
[PASSED QA] Bug 10602 - followup to remove tabs (2.47 KB, patch)
2013-09-30 17:54 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Druart 2013-07-17 12:52:30 UTC

    
Comment 1 Jonathan Druart 2013-07-17 12:53:37 UTC Comment hidden (obsolete)
Comment 2 Jonathan Druart 2013-07-17 12:54:34 UTC
*** Bug 4887 has been marked as a duplicate of this bug. ***
Comment 3 I'm just a bot 2013-09-18 10:43:14 UTC
Applying: Bug 10602: Set a default value for authorities
Using index info to reconstruct a base tree...
M	installer/data/mysql/kohastructure.sql
M	installer/data/mysql/updatedatabase.pl
Falling back to patching base and 3-way merge...
Auto-merging installer/data/mysql/updatedatabase.pl
CONFLICT (content): Merge conflict in installer/data/mysql/updatedatabase.pl
Auto-merging installer/data/mysql/kohastructure.sql
Patch failed at 0001 Bug 10602: Set a default value for authorities
The copy of the patch that failed is found in:
   /home/christopher/git/koha/.git/rebase-apply/patch
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
Comment 4 Jonathan Druart 2013-09-18 12:01:51 UTC Comment hidden (obsolete)
Comment 5 Bernardo Gonzalez Kriegel 2013-09-29 04:03:55 UTC
Testing this.

Solved little merge conflict in updatedatabase.pl
Run it, new column added.

Edit framework, put default value on sample tag, ej. 040c
Nothing is saved :(
Comment 6 I'm just a bot 2013-09-29 04:30:18 UTC
Applying: Bug 10602: Set a default value for authorities
Using index info to reconstruct a base tree...
M	installer/data/mysql/updatedatabase.pl
Falling back to patching base and 3-way merge...
Auto-merging installer/data/mysql/updatedatabase.pl
CONFLICT (content): Merge conflict in installer/data/mysql/updatedatabase.pl
Patch failed at 0001 Bug 10602: Set a default value for authorities
The copy of the patch that failed is found in:
   /home/christopher/git/koha/.git/rebase-apply/patch
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
Comment 7 Chris Cormack 2013-09-29 04:37:09 UTC Comment hidden (obsolete)
Comment 8 Katrin Fischer 2013-09-29 08:59:36 UTC
Bit worried about Bernardo's comment a bit earlier - do we know what happened there?
Comment 9 Katrin Fischer 2013-09-29 13:54:40 UTC
I am sorry, but I have to agree with Bernardo - this is not yet working for me:

Verified database update is done correctly.

Controlfields 0xx
- Editing an existing field (001)
- Setting a default value for subfield @
NOT OK There is nothing in the logs, but the default value does not save
Also somehow the plugin information ended up in the default column when 
I tried this?

Fields
- Editing an existing field 100
- Setting a default value for subfield e
NOT OK Default value is not saved - it doesn't show on repeated editing 
and it's also not in the database.
Comment 10 Jonathan Druart 2013-09-30 12:26:27 UTC Comment hidden (obsolete)
Comment 11 Jonathan Druart 2013-09-30 12:27:37 UTC
Yes, my bad. Little error on inserting in DB.
Comment 12 Bernardo Gonzalez Kriegel 2013-09-30 15:28:42 UTC Comment hidden (obsolete)
Comment 13 Bernardo Gonzalez Kriegel 2013-09-30 15:29:25 UTC Comment hidden (obsolete)
Comment 14 Katrin Fischer 2013-09-30 17:53:56 UTC
Created attachment 21679 [details] [review]
[PASSED QA] Bug 10602: Set a default value for authorities

Some code already exist but the feature does not work.

This patch allows to define default values in the authorities framework.

Test plan:
1/ Choose a framework, field and subfields.
2/ Define a default value.
3/ Create a new authority and check that the subfield is
automatically filled with the default value.

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Work as described. koha-qa reports some tabs, fixed in followup

Test
1) Apply patch, run updatedatabase.pl
2) Edit auth framework, put default value someware, save
3) Add new auth, default value present

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Passes all tests and QA script.
Verified database update is done correctly.

Controlfields 0xx
- Edited an existing field (001)
- Set a default value for subfield @
- Edited subfield again, checking default was saved correctly
- Verified the default shows up correctly when creating a
  new authority using this authority type

Fields
- Edited an existing field (100)
- Set a default value for subfield e
- Edited subfield again, checking default was saved correctly
- Verified the default shows up correctly when creating a
  new authority using this authority type
Comment 15 Katrin Fischer 2013-09-30 17:54:10 UTC
Created attachment 21680 [details] [review]
[PASSED QA] Bug 10602 - followup to remove tabs

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Comment 16 Galen Charlton 2013-10-10 23:34:30 UTC
Pushed to master.  Thanks, Jonathan!
Comment 17 Sophie MEYNIEUX 2013-11-22 09:31:03 UTC
This patch prevents to add new subfields in authorities. Filed Bug 11286