Bug 7086

Summary: Suggested by not saved when creating suggestions in staff
Product: Koha Reporter: Katrin Fischer <katrin.fischer>
Component: AcquisitionsAssignee: Adrien SAURAT <adrien.saurat>
Status: CLOSED FIXED QA Contact: Bugs List <koha-bugs>
Severity: major    
Priority: P5 - low CC: adrien.saurat, jcamins, koha.sekjal, paul.poulain
Version: 3.8   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Attachments: screenshot
proposed patch
proposed patch #2
Bug 7086 : "suggested by" fixed for staff members

Description Katrin Fischer 2011-10-25 13:08:21 UTC
Created attachment 6049 [details]
screenshot

When creating a new suggeston from the suggestion module in staff, 'suggested by' is not saved to the database (0 instead). Only 'managed by' is saved.

When creating a new suggestion the 'status' is hidden. So you can't create and manage at the same time at the moment. Because of this I think for new suggestions it should save 'suggested by' instead of 'managed by'.
Comment 1 Katrin Fischer 2012-03-08 06:46:34 UTC
This bug still occurs in master. It's even a bit more worse now, because we show the suggestor on neworderempty. When the suggestion was created in staff no suggestor will be shown.
Comment 2 Adrien SAURAT 2012-03-08 09:40:14 UTC
So we should have the following behaviour ?

1) If any user (staff or not) adds a suggestion, his name appears in "Suggested by", nothing in "Managed by".

2) When a staff member edits a suggestion, "Suggested by" does not change but "Managed by" gets the name of the staff member editing.

Right ?
Comment 3 Adrien SAURAT 2012-03-08 09:56:58 UTC
In fact, it seems to me that when you create a new suggestion, all the statuses now appear, so if that's better we can initialise "suggested by" and "managed by" at the same time.
Comment 4 Adrien SAURAT 2012-03-08 10:03:25 UTC Comment hidden (obsolete)
Comment 5 Adrien SAURAT 2012-03-08 10:11:02 UTC
With this patch, both fields (managed, suggested) are stored when a staff member adds a suggestion. They are both displayed in the creation page.

But I'm thinking now that I may have misunderstood you. You were probably talking about the ASKED/ACCEPTED status. Does this patch make sense or should we really remove the "Managed by" info when creating a new suggestion ?
Comment 6 Katrin Fischer 2012-03-08 11:57:20 UTC
I tested in 3.6.3 yesterday and found it was not possible to create a suggestion and change the status to accepted at the same time. Seems it has changed - trying to test asap :) Thx for the patch!
Comment 7 Katrin Fischer 2012-03-08 11:59:05 UTC
Hm, thinking about it, could we only set managed by if the status of the suggestion is changed from Asked/Empty to something else?
Comment 8 Katrin Fischer 2012-03-08 21:00:13 UTC
I checked again. At the moment I can't set the status to accepted when adding a suggestion in staff. I am not sure managed by should be filled at all, when the status is still empty / not set?
Comment 9 Adrien SAURAT 2012-03-09 08:31:46 UTC
Indeed, I misunderstood what you meant the first time, I'll make another patch.
Comment 10 Adrien SAURAT 2012-03-15 14:01:58 UTC Comment hidden (obsolete)
Comment 11 Jared Camins-Esakov 2012-03-17 09:49:46 UTC
Created attachment 8251 [details] [review]
Bug 7086 : "suggested by" fixed for staff members

Now:
- suggested by is stored when a staff member makes a suggestion
- managed by is only updated when a suggestion is edited (not when
it is created)

Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Comment 12 Ian Walls 2012-03-19 13:24:00 UTC
Change to suggestion/suggestion.pl is clean, readable and well-commented.  Handles more cases more elegantly.  Marking as Passed QA.
Comment 13 Adrien SAURAT 2012-03-19 13:34:10 UTC
Oh, but I forgot to remove the following line :
warn $suggestion->{'manageddate'};

Not really a bug, but the logs won't need this. I don't know if I should make a new patch without it, or if Paul will just remove the line when pushing to master?
Comment 14 Paul Poulain 2012-03-20 12:49:38 UTC
(In reply to comment #13)
> Oh, but I forgot to remove the following line :
> warn $suggestion->{'manageddate'};
> 
> Not really a bug, but the logs won't need this. I don't know if I should
> make a new patch without it, or if Paul will just remove the line when
> pushing to master?

I've removed the offending line & pushed the patch

(I also have noticed the warn with my pre-apply hook, hooks++ !!!)
Comment 15 Jared Camins-Esakov 2012-05-03 23:04:40 UTC
The patches for this bug do not apply to 3.6. If you want this included in 3.6.x, please rebase on 3.6.x and reset the version to rel_3_6.