Bug 9163 - Cataloguing validation workflow
Summary: Cataloguing validation workflow
Status: Failed QA
Alias: None
Product: Koha
Classification: Unclassified
Component: Cataloging (show other bugs)
Version: master
Hardware: All All
: P1 - high new feature (vote)
Assignee: Alex Arnaud
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-11-28 12:10 UTC by Vitor Fernandes
Modified: 2016-11-24 07:52 UTC (History)
12 users (show)

See Also:
Change sponsored?: Sponsored
Patch complexity: Medium patch
Who signed the patch off:
Text to go in the release notes:
Version(s) released in:


Attachments
BUG 9163 - Cataloguing validation workflow (10.58 KB, patch)
2012-11-28 15:58 UTC, Vitor Fernandes
Details | Diff | Splinter Review
BUG 9163 - Patch2 use user permissions instead of systempreferences (14.25 KB, patch)
2012-11-28 17:27 UTC, Vitor Fernandes
Details | Diff | Splinter Review
BUG 9163 - Cataloguing validation workflow (10.56 KB, patch)
2013-03-19 13:30 UTC, Fridolin SOMERS
Details | Diff | Splinter Review
BUG 9163 - Patch2 use user permissions instead of systempreferences (14.29 KB, patch)
2013-03-19 13:31 UTC, Fridolin SOMERS
Details | Diff | Splinter Review
BUG 9163 - Cataloguing validation workflow (10.56 KB, patch)
2013-03-20 14:22 UTC, Fridolin SOMERS
Details | Diff | Splinter Review
BUG 9163 - Patch2 use user permissions instead of systempreferences (14.45 KB, patch)
2013-03-20 14:31 UTC, Fridolin SOMERS
Details | Diff | Splinter Review
patch rebased (10.49 KB, patch)
2013-03-21 11:22 UTC, Christophe Croullebois
Details | Diff | Splinter Review
second patch rebased (14.43 KB, patch)
2013-03-21 13:13 UTC, Christophe Croullebois
Details | Diff | Splinter Review
patch rebased (10.50 KB, patch)
2013-03-21 16:19 UTC, Christophe Croullebois
Details | Diff | Splinter Review
BUG 9163 - Cataloguing validation workflow (10.46 KB, patch)
2013-06-28 08:49 UTC, Jonathan Druart
Details | Diff | Splinter Review
BUG 9163 - Patch2 use user permissions instead of systempreferences (14.45 KB, patch)
2013-06-28 08:49 UTC, Jonathan Druart
Details | Diff | Splinter Review
BUG 9163 - Cataloguing validation workflow (10.50 KB, patch)
2013-09-18 12:12 UTC, Fridolin SOMERS
Details | Diff | Splinter Review
BUG 9163 - Patch2 use user permissions instead of systempreferences (14.58 KB, patch)
2013-09-18 12:12 UTC, Fridolin SOMERS
Details | Diff | Splinter Review
BUG 9163 - Cataloguing validation workflow (10.47 KB, patch)
2015-12-08 09:06 UTC, Alex Arnaud
Details | Diff | Splinter Review
BUG 9163 - Patch2 use user permissions instead of systempreferences (9.56 KB, patch)
2015-12-08 09:06 UTC, Alex Arnaud
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Vitor Fernandes 2012-11-28 12:10:59 UTC
New feature to have cataloguing validation workflow (some user validates the cataloguing of others and put the record online in OPAC).
The idea is the following:

- all framework needs to have suppress subfield hidden
- the normal cataloguers uses this frameworks to catalogue the record
- the record will not have suppress subfield filled (I don't know what happens when the record has no suppress - if it appears there is the need of set suppress = 1 automatically)
- there is special framework with suppress subfield visible
- only some users have access to the special framework
- those users uses the special framework to validate the cataloguing and set suppress = 0 if everything is OK (after indexation the record appears online in OPAC)

To have this working there is the need of a multi system preference with 3 options:

1 - Turn on/off the validation workflow (controll the appearing of the special framework in the dropdown list in addbook.pl and addbiblio.pl, set suppress = 1 if needed, etc)
2 - Set which will be the special framework (text box to set the framework code)
3 - List of users with access to this functionallity separated by comma (can be a permission but if the validation is off the permission has no sense, can be a file in the Koha structure with each username in one line, etc...)
Comment 1 Vitor Fernandes 2012-11-28 15:58:25 UTC Comment hidden (obsolete)
Comment 2 Vitor Fernandes 2012-11-28 17:27:42 UTC Comment hidden (obsolete)
Comment 3 Kyle M Hall 2012-12-14 14:38:29 UTC
Could you please add a test plan for this patch?
Comment 4 Vitor Fernandes 2012-12-14 18:46:27 UTC
Hi Kyle,

Sorry for not having a test plan.
This patch was added before the adding of the guidelines for submitting patches.

Test plan:

- OpacSuppression must be active
- set CatalogingValidation on
- change all frameworks to have 942$n hidden
- create a framework with 942$n visible (this framework will be the validation framework)
- set CatalogingValidationFramework = code of validation framework

- you will need to users to test (or you will have to change the permissions): set to one for them permissions to access the validation framework

- try to catalogue with one user that doesn't have permission : the validation framework shouldn't appear (even on addbiblio.pl and addbook.pl)

- try to catalogue with one user that have permissions : the validation framework should appear (even on addbiblio.pl and addbook.pl)

- when cataloguing with frameworks different than the validation, the records should be added with 942$n = 1- so the cataloguing is done but needs validation

- with the validation framework access the record added, validade the cataloguing and then set the 942$n = 0 - cataloguing validated

If you have any question, be free to ask.

NOTE: I've saw a error on CataloguingValidation system preference description, but you can correct it:

OPACSuppresion -> OpacSuppression
The users with access to the validation framework are set in CatalogingValidationUsers -> you can remove this line

THANKS Kyle.
Comment 5 Fridolin SOMERS 2013-03-19 13:30:40 UTC Comment hidden (obsolete)
Comment 6 Fridolin SOMERS 2013-03-19 13:31:13 UTC Comment hidden (obsolete)
Comment 7 Frederic Durand 2013-03-20 14:00:39 UTC
Testing it on sandbox, when trying to access to Cataloguing, got this error message : 
Missing right curly or square bracket at /home/koha/src/cataloguing/addbooks.pl line 158, at end of line
syntax error at /home/koha/src/cataloguing/addbooks.pl line 158, at EOF
Execution of /home/koha/src/cataloguing/addbooks.pl aborted due to compilation errors.
Comment 8 Fridolin SOMERS 2013-03-20 14:22:06 UTC Comment hidden (obsolete)
Comment 9 Fridolin SOMERS 2013-03-20 14:31:09 UTC Comment hidden (obsolete)
Comment 10 Fridolin SOMERS 2013-03-20 14:31:52 UTC
Resumbitted patches(In reply to comment #7)
> Testing it on sandbox, when trying to access to Cataloguing, got this error
> message : 
> Missing right curly or square bracket at
> /home/koha/src/cataloguing/addbooks.pl line 158, at end of line
> syntax error at /home/koha/src/cataloguing/addbooks.pl line 158, at EOF
> Execution of /home/koha/src/cataloguing/addbooks.pl aborted due to
> compilation errors.

Corrected
Comment 11 Frederic Durand 2013-03-21 08:26:43 UTC
Testing on sandbox, did not work cause of : 
Applying: BUG 9163 - Cataloguing validation workflow
Using index info to reconstruct a base tree...
Falling back to patching base and 3-way merge...
Auto-merging installer/data/mysql/sysprefs.sql
CONFLICT (content): Merge conflict in installer/data/mysql/sysprefs.sql
Auto-merging installer/data/mysql/updatedatabase.pl
CONFLICT (content): Merge conflict in installer/data/mysql/updatedatabase.pl
Failed to merge in the changes.
Comment 12 Christophe Croullebois 2013-03-21 11:22:01 UTC Comment hidden (obsolete)
Comment 13 Christophe Croullebois 2013-03-21 13:13:15 UTC Comment hidden (obsolete)
Comment 14 Christophe Croullebois 2013-03-21 16:19:12 UTC Comment hidden (obsolete)
Comment 15 Pierre Angot 2013-03-22 09:04:39 UTC
Test on sandbox :

Something went wrong !
Applying: BUG 9163 - Patch2 use user permissions instead of systempreferences
Repository lacks necessary blobs to fall back on 3-way merge.
Cannot fall back to three-way merge.
Patch failed at 0001 BUG 9163 - Patch2 use user permissions instead of systempreferences
When you have resolved this problem run "git am --resolved".
If you would prefer to skip this patch, instead run "git am --skip".
To restore the original branch and stop patching run "git am --abort".
Bug 9163 - Cataloguing validation workflow

second patch rebased
Apply? [yn]
Patch left in /tmp/second-patch-rebased-FeeYi6.patch
Comment 16 Jonathan Druart 2013-06-28 08:49:08 UTC Comment hidden (obsolete)
Comment 17 Jonathan Druart 2013-06-28 08:49:14 UTC Comment hidden (obsolete)
Comment 18 Jonathan Druart 2013-06-28 08:49:45 UTC
Fix patches order + rebase.
Comment 19 I'm just a bot 2013-09-18 09:49:04 UTC
Applying: BUG 9163 - Cataloguing validation workflow
Using index info to reconstruct a base tree...
M	cataloguing/addbiblio.pl
M	cataloguing/addbooks.pl
M	installer/data/mysql/sysprefs.sql
M	installer/data/mysql/updatedatabase.pl
Falling back to patching base and 3-way merge...
Auto-merging installer/data/mysql/updatedatabase.pl
Auto-merging installer/data/mysql/sysprefs.sql
CONFLICT (content): Merge conflict in installer/data/mysql/sysprefs.sql
Auto-merging cataloguing/addbooks.pl
Auto-merging cataloguing/addbiblio.pl
Patch failed at 0001 BUG 9163 - Cataloguing validation workflow
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 20 Fridolin SOMERS 2013-09-18 11:57:26 UTC
I am rebasing the patches
Comment 21 Fridolin SOMERS 2013-09-18 12:12:02 UTC Comment hidden (obsolete)
Comment 22 Fridolin SOMERS 2013-09-18 12:12:54 UTC Comment hidden (obsolete)
Comment 23 I'm just a bot 2013-09-29 06:06:11 UTC
Patch applied cleanly, go forth and signoff
Comment 24 Doug Kingston 2013-10-19 01:40:26 UTC
When using the sandbox to try and test this, I tried searching for 'test' before proceeding with the test plan and got this error message:
Error: Can't call method "raw" on an undefined value at /home/koha/src/C4/Search.pm line 490.

I do not get this if I build a sandbox from "msster" instead of "9163".

I subsequently tried to follow the test plan and got to the point of checking to see if I can see the new record and get the error above.  Could you review the test plan in light of the fact that you are now using user permissions.  I think I did the right thing here but it would be good to have more explicit instructions.  Also there are a few options for visibility in the framework and for access under cataloging for user permissions.  Being more precise with how those should be set would be good.
Comment 25 I'm just a bot 2013-10-30 07:37:45 UTC
Patch applied cleanly, go forth and signoff
Comment 26 Fridolin SOMERS 2014-03-25 08:13:43 UTC
(In reply to Doug Kingston from comment #24)
> When using the sandbox to try and test this, I tried searching for 'test'
> before proceeding with the test plan and got this error message:
> Error: Can't call method "raw" on an undefined value at
> /home/koha/src/C4/Search.pm line 490.
This is a known bug, it means there is no results, for a search with a sort order not on relevance.
Comment 27 paxed 2014-03-25 08:38:06 UTC
(In reply to Fridolin SOMERS from comment #26)
> (In reply to Doug Kingston from comment #24)
> > When using the sandbox to try and test this, I tried searching for 'test'
> > before proceeding with the test plan and got this error message:
> > Error: Can't call method "raw" on an undefined value at
> > /home/koha/src/C4/Search.pm line 490.
> This is a known bug, it means there is no results, for a search with a sort
> order not on relevance.

Indeed: See bug 9578
Comment 28 Nick Clemens 2014-07-30 20:09:57 UTC
I'd be happy to test and get this moving again but needs rebase

Applying: BUG 9163 - Cataloguing validation workflow
Using index info to reconstruct a base tree...
Falling back to patching base and 3-way merge...
Auto-merging koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref
CONFLICT (content): Merge conflict in koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref
Auto-merging installer/data/mysql/updatedatabase.pl
Auto-merging installer/data/mysql/sysprefs.sql
Auto-merging cataloguing/addbooks.pl
Auto-merging cataloguing/addbiblio.pl
Failed to merge in the changes.
Patch failed at 0001 BUG 9163 - Cataloguing validation workflow
When you have resolved this problem run "git bz apply --continue".
If you would prefer to skip this patch, instead run "git bz apply --skip".
To restore the original branch and stop patching run "git bz apply --abort".
Patch left in /tmp/BUG-9163---Cataloguing-validation-workflow-_DFxmQ.patch
Comment 29 Alex Arnaud 2015-12-08 09:06:21 UTC
Created attachment 45474 [details] [review]
BUG 9163 - Cataloguing validation workflow

Added 3 systems preferences instead of one:

- 1 to use/not use the validation workflow
- 1 to set the validation framework code
- 1 to set the users with access to the validation framework

addbook.pl and addbiblio.pl show the frameworkcodes in the drop list according to settings:

- if validation off shows all
- if validation on and framework code is different than validation framework code, shows the framework code
- if validation on and framework code equal to validation framework code and the user have permissions, shows the framework code
- if validation on and framework code equal to validation framework code and the user doesn't have permissions, don't shows the framework code

addbiblio.pl also changed to:

- prevent any user to use the validation framework (if validation on) when putting the code in the browser URL
- if validation on always set suppress = 1 in framework different than the validating one
Comment 30 Alex Arnaud 2015-12-08 09:06:29 UTC
Created attachment 45475 [details] [review]
BUG 9163 - Patch2 use user permissions instead of systempreferences

New user permission added to access the validation framework, under edit catalogue section.
Comment 31 Alex Arnaud 2015-12-08 09:07:00 UTC
Patch rebased.
Comment 32 Laurence Rault 2016-03-24 13:56:17 UTC
Tested on sandbox, unimarc and marc21

"- The users with access to the validation framework are set in CatalogingValidationUsers." : this text in CatalogingValidation description should be removed or replaced with something like "Users with access to the validation framework should have the cataloging_validation_framework permission"

The cataloging_validation_framework permission does not exist at all

I feel disturbing that suppress=1 is set on 942$n in the code : that means that this will work only for marc21 configuration. How about unimarc ?
I think it would be better to be able configure the framework field/subfield concerned with suppress status