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'.
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.
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 ?
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.
Created attachment 8076 [details] [review] proposed patch
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 ?
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!
Hm, thinking about it, could we only set managed by if the status of the suggestion is changed from Asked/Empty to something else?
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?
Indeed, I misunderstood what you meant the first time, I'll make another patch.
Created attachment 8212 [details] [review] proposed patch #2 New patch with "Managed by" being updated only when the suggestion is edited.
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>
Change to suggestion/suggestion.pl is clean, readable and well-commented. Handles more cases more elegantly. Marking as Passed QA.
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?
(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++ !!!)
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.