CRM-14986 fix DB error on date find + save
authorEileen McNaughton <eileen@fuzion.co.nz>
Tue, 15 Jul 2014 03:33:03 +0000 (15:33 +1200)
committerEileen McNaughton <eileen@fuzion.co.nz>
Tue, 15 Jul 2014 03:35:15 +0000 (15:35 +1200)
commitbbf58b03d81202e8c9f113f33796a8d4d29c9703
treee88efb362641fc4dd6aebe6c0cb3b6704bfa9b88
parent7e0bb4f33a66cba313f5c55b7580ff2decb805b8
CRM-14986 fix DB error on date find + save
this is manefesting in the failure to save contributions, however, it has been a recurrent problem
that the format used for date fields on ->find does not match the requirement of ->save
hence we see in the ContributionRecur class 3 lines like
->modified_date = CRM_Utils_Date::isoToMysql(->modified_date);
which exist simply to format the date fields for re-save.
The end_date & next_scheduled_date were missed - resulting in fatals when this function
is used
It seems kind of crazy to keep solving this problem in the form & BAO layer
so this commit is tests only & there is a commit on the packages dir
that alters the DAO->update fn to check for the presence of a '-' & do the isoToMysql there
instead.
CRM/Contribute/BAO/ContributionRecur.php
tests/phpunit/CRM/Contribute/BAO/ContributionRecurTest.php [new file with mode: 0644]