Adding a comment in the Add an Admin comment text area at /admin/store/orders/XXX/edit
Message from dblog :
Drupal\Core\Database\IntegrityConstraintViolationException : SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'order_id' cannot be null: INSERT INTO {uc_order_admin_comments} (order_id, uid, message, created) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3); Array ( [:db_insert_placeholder_0] => [:db_insert_placeholder_1] => 1 [:db_insert_placeholder_2] => aaa [:db_insert_placeholder_3] => 1498785400 ) dans Drupal\Core\Database\Connection->handleQueryException() (ligne 682 de /home/ubuntu/workspace/core/lib/Drupal/Core/Database/Connection.php).
Comment | File | Size | Author |
---|---|---|---|
#10 | 2890917-10.patch | 7.55 KB | TR |
| |||
#7 | 2890917-7.patch | 7.09 KB | TR |
| |||
#6 | admin-comments-test-only.patch | 6.33 KB | TR |
#4 | 2890917-4.patch | 777 bytes | TR |
| |||
#3 | 2890917-3.patch | 673 bytes | TR |
|
Comments
Comment #2
TR CreditAttribution: TR commentedIt works for me if I add the admin comment at /admin/store/orders/XXX but I get the same error as you when I try that at /admin/store/orders/XXX/edit.
Comment #3
TR CreditAttribution: TR commentedThis should fix it.
Comment #4
TR CreditAttribution: TR commentedActually, this is probably a better fix.
Comment #5
TR CreditAttribution: TR commentedIt seems we don't have any tests for adding order comments. There are four places this can be done:
We should add test cases to ensure that adding order comments in all four of these places works. I'll defer committing this until the tests are written.
Comment #6
TR CreditAttribution: TR commentedHere's a patch containing a set of tests which test the four ways to add order comments which I listed above.
The test that tests scenario 2) should FAIL because of the reported bug.
Comment #7
TR CreditAttribution: TR commentedNow here's the same set of tests but this time with the fix from #4 included. These tests should all pass.
Comment #9
TR CreditAttribution: TR commentedHmm, there's still a problem with the test - I'm getting intermittent failures doing text comparisons between the randomly-generated comment text and what shows up on the page. I think it's an HTML escaping problem - I'd like to settle that before I commit the new tests.
Comment #10
TR CreditAttribution: TR commentedOK, I ran this version 100 times locally without a fail - I think this should be good to go. This has the improved tests plus the fix from #4.
Comment #12
TR CreditAttribution: TR commentedCommitted #10.