Bug 23854 - Cannot edit a suggestion
Summary: Cannot edit a suggestion
Status: Pushed to stable
Alias: None
Product: Koha
Classification: Unclassified
Component: Acquisitions (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low major (vote)
Assignee: Jonathan Druart
QA Contact: Martin Renvoize
URL:
Keywords:
Depends on:
Blocks: 23590
  Show dependency treegraph
 
Reported: 2019-10-21 15:49 UTC by Jonathan Druart
Modified: 2019-11-15 12:41 UTC (History)
4 users (show)

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


Attachments
Bug 23854: Fix failure on dates when editing a suggestion (1.12 KB, patch)
2019-10-22 09:11 UTC, Jonathan Druart
Details | Diff | Splinter Review
[ON TOP OF 14973] Bug 23854: Fix failure on dates when editing a suggestion (1.12 KB, patch)
2019-11-12 14:09 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 23854: Fix failure on dates when editing a suggestion (1.43 KB, patch)
2019-11-13 14:45 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 23854: Fix failure on dates when editing a suggestion (1.49 KB, patch)
2019-11-13 17:12 UTC, Martin Renvoize
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Druart 2019-10-21 15:49:47 UTC
I get:

DBD::mysql::st execute failed: Incorrect date value: '21/10/2019' for column `koha_kohadev`.`suggestions`.`accepteddate` at row 1 [for Statement "UPDATE `suggestions` SET `accepteddate` = ?, `budgetid` = ?, `copyrightdate` = ?, `manageddate` = ?, `quantity` = ?, `rejecteddate` = ?, `suggesteddate` = ? WHERE ( `suggestionid` = ? )" with ParamValues: 0="21/10/2019", 1=undef, 2=undef, 3='2019-10-21T17:33:23', 4=undef, 5='2019-10-21T17:33:23', 6='2019-10-21T00:00:00', 7=1] at /usr/share/perl5/DBIx/Class/Storage/DBI.pm line 1836.

Could someone confirm? Is it a recent regression?
Comment 1 Jonathan Druart 2019-10-22 09:10:47 UTC
Ok, so, it' weird.

Here are the different bugs I found:
1. Edit an existing suggestion that is accepted or rejected, do not change anything and save
=> You get the failure about the accepteddate format "Incorrect date value"

2. Edit an accepted suggestion, change the accepteddate (not today).
=> No failure but the accepteddate is set to today

3. Same for manageddate if a status is set
Comment 2 Jonathan Druart 2019-10-22 09:11:47 UTC
Created attachment 94518 [details] [review]
Bug 23854: Fix failure on dates when editing a suggestion
Comment 3 Jonathan Druart 2019-10-22 09:13:05 UTC
The proposed patch will only fix 1.

What is the expected behavior for other dates? If they cannot be edited manually we should disable the inputs.
Comment 4 Séverine Queune 2019-10-22 10:00:45 UTC
I think these 3 dates should be set automatically.
I can't see any reason, if we want to keep reliable informations about the workflows, where the dates should be manually updated.

Will try to test this afternoon, but not sure about my bug comprehension...
Comment 5 Jonathan Druart 2019-11-06 16:43:48 UTC
Setting to Needs Signoff to collect ideas.
Comment 6 Jonathan Druart 2019-11-12 14:09:59 UTC
Created attachment 95316 [details] [review]
[ON TOP OF 14973] Bug 23854: Fix failure on dates when editing a suggestion

This is the patch to use if bug 14973 is pushed first.
Comment 7 Katrin Fischer 2019-11-13 14:10:49 UTC
Sorry, but I was not able to reproduce this issue:

- In acquisition, I found a accepted suggestoin
- Edit suggestion using the button at the end of the line
- Changing nothing, saving
- No error in GUI or log

From the result list:

- Changed status from accepted to pending
- No error in the GUI, warning in the logs:

No suggestions ASKED letter transported by email at /home/vagrant/kohaclone/C4/Letters.pm line 608.
CGI::param called in list context from /home/vagrant/kohaclone/suggestion/suggestion.pl line 237, this can lead to vulnerabilities. See the warning in "Fetching the value or values of a single named parameter" at /usr/share/perl5/CGI.pm line 412.


I think I need more information here.
Comment 8 Katrin Fischer 2019-11-13 14:45:21 UTC
Created attachment 95397 [details] [review]
Bug 23854: Fix failure on dates when editing a suggestion

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

- Watch plack-error-log
- Change an accepted suggestion to 'No Status'
- Verify error in the logs (use strict mode, depending on DBMS version)
- Status changed was not saved
- Apply patch
- Verify the error is gone, change is saved now.
Comment 9 Martin Renvoize 2019-11-13 17:12:15 UTC
Created attachment 95409 [details] [review]
Bug 23854: Fix failure on dates when editing a suggestion

- Watch plack-error-log
- Change an accepted suggestion to 'No Status'
- Verify error in the logs (use strict mode, depending on DBMS version)
- Status changed was not saved
- Apply patch
- Verify the error is gone, change is saved now.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 10 Martin Renvoize 2019-11-13 17:12:58 UTC
Thanks guys, all works for me here. Passing QA
Comment 11 Martin Renvoize 2019-11-13 17:16:43 UTC
Nice work!

Pushed to master for 19.11.00
Comment 12 Fridolin SOMERS 2019-11-15 12:41:45 UTC
Pushed to 19.05.x for 19.05.05