Data too long for column 'source'
The source of a declaration might end up being the title of the contribution page from which the contribution comes from. But:
- the length allowed for the title of a contribution page is 255 characters (see xml/schema/Contribute/ContributionPage.xml#L26)
- and the length allowed for the source of a Gift Aid declaration is only 32 characters (see CRM/Civigiftaid/Upgrader.php#L773).
So a contribution sent through a contribution page titled: Standard Donation Form for Donate Page
, would cause an error like:
Nov 16 22:37:09 [error] $Fatal Error Details = Array
(
[callback] => Array
(
[0] => CRM_Core_Error
[1] => handle
)
[code] => -1
[message] => DB Error: unknown error
[mode] => 16
[debug_info] => UPDATE civicrm_value_gift_aid_declaration SET
entity_id=220799,eligible_for_gift_aid=3,address='1 Street',post_code='PS1 TA2',
start_date=20201116223703,given_date=20201116223703,
source='Standard Donation Form for Donate Page'
WHERE id=17066
[nativecode=1406 ** Data too long for column 'source' at row 1]
[type] => DB_Error
[user_info] => UPDATE civicrm_value_gift_aid_declaration SET
entity_id=220799,eligible_for_gift_aid=3,address='1 Street',post_code='PS1 TA2',
start_date=20201116223703,given_date=20201116223703,
source='Standard Donation Form for Donate Page'
WHERE id=17066
[nativecode=1406 ** Data too long for column 'source' at row 1]
[to_string] => [db_error: message="DB Error: unknown error" code=-1 mode=callback callback=CRM_Core_Error::handle prefix="" info="UPDATE civicrm_value_gift_aid_declaration SET
entity_id=220799,eligible_for_gift_aid=3,address='1 Street',post_code='PS1 TA2',
start_date=20201116223703,given_date=20201116223703,
source='Standard Donation Form for Donate Page'
WHERE id=17066
[nativecode=1406 ** Data too long for column 'source' at row 1]"]
)
Edited by capo