Bug 7086 - Suggested by not saved when creating suggestions in staff
Summary: Suggested by not saved when creating suggestions in staff
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Acquisitions (show other bugs)
Version: 3.8
Hardware: All All
: P5 - low major (vote)
Assignee: Adrien SAURAT
QA Contact: Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-10-25 13:08 UTC by Katrin Fischer
Modified: 2013-12-05 20:01 UTC (History)
4 users (show)

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


Attachments
screenshot (40.16 KB, image/png)
2011-10-25 13:08 UTC, Katrin Fischer
Details
proposed patch (981 bytes, patch)
2012-03-08 10:03 UTC, Adrien SAURAT
Details | Diff | Splinter Review
proposed patch #2 (2.47 KB, patch)
2012-03-15 14:01 UTC, Adrien SAURAT
Details | Diff | Splinter Review
Bug 7086 : "suggested by" fixed for staff members (2.57 KB, patch)
2012-03-17 09:49 UTC, Jared Camins-Esakov
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
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.