Page MenuHomePhabricator

Stray comma causes all kinds of failures in Civi records
Closed, DeclinedPublic

Description

Wow... steps to reproduce seem to be,

  • Create a new contribution from the CiviCRM GUI, and enter a comma in the "source" amount, e.g. "USD 123,456".

The contribution becomes uneditable, and toxic to the thank-you job...

https://civicrm.wikimedia.org/civicrm/contact/view/contribution?reset=1&action=update&id=11461418&cid=498872&context=contribution

Tried to add a no_thank_you reason, and...

Exception: "A fatal error was triggered"

#0 /srv/org.wikimedia.civicrm/civicrm/CRM/Core/DAO.php(755): CRM_Core_Error::fatal()
#1 /srv/org.wikimedia.civicrm/civicrm/CRM/Contribute/Form/Contribution.php(1212): CRM_Core_DAO::getFieldValue("CRM_Price_DAO_Field", NULL, "price_set_id")
#2 /srv/org.wikimedia.civicrm/civicrm/CRM/Core/Form.php(261): CRM_Contribute_Form_Contribution->postProcess()
#3 /srv/org.wikimedia.civicrm/civicrm/CRM/Core/QuickForm/Action/Upload.php(151): CRM_Core_Form->mainProcess()
#4 /srv/org.wikimedia.civicrm/civicrm/CRM/Core/QuickForm/Action/Upload.php(128): CRM_Core_QuickForm_Action_Upload->realPerform(Object(CRM_Contribute_Form_Contribution), "upload")
#5 /srv/org.wikimedia.civicrm/civicrm/packages/HTML/QuickForm/Controller.php(203): CRM_Core_QuickForm_Action_Upload->perform(Object(CRM_Contribute_Form_Contribution), "upload")
#6 /srv/org.wikimedia.civicrm/civicrm/packages/HTML/QuickForm/Page.php(103): HTML_QuickForm_Controller->handle(Object(CRM_Contribute_Form_Contribution), "upload")
#7 /srv/org.wikimedia.civicrm/civicrm/CRM/Core/Controller.php(310): HTML_QuickForm_Page->handle("upload")
#8 /srv/org.wikimedia.civicrm/civicrm/CRM/Contribute/Page/Tab.php(296): CRM_Core_Controller->run()
#9 /srv/org.wikimedia.civicrm/civicrm/CRM/Contribute/Page/Tab.php(353): CRM_Contribute_Page_Tab->edit()
#10 /srv/org.wikimedia.civicrm/civicrm/CRM/Core/Invoke.php(220): CRM_Contribute_Page_Tab->run((Array:4), NULL)
#11 /srv/org.wikimedia.civicrm/civicrm/CRM/Core/Invoke.php(51): CRM_Core_Invoke::_invoke((Array:4))
#12 /srv/org.wikimedia.civicrm/civicrm/drupal/civicrm.module(500): CRM_Core_Invoke::invoke((Array:4))
#13 [internal function](): civicrm_invoke("contact", "view", "contribution")
#14 /srv/org.wikimedia.civicrm/drupal/includes/menu.inc(517): call_user_func_array("civicrm_invoke", (Array:3))
#15 /srv/org.wikimedia.civicrm/drupal/index.php(21): menu_execute_active_handler()
#16 {main}

Event Timeline

awight raised the priority of this task from to Needs Triage.
awight updated the task description. (Show Details)
awight added a project: Wikimedia-Fundraising.
awight subscribed.

So far, I think this might have been something related to a comma in the contribution_source field, which might be breaking hooks?

awight renamed this task from Fatal error while editing a contribution to Stray comma causes all kinds of failures.Feb 20 2015, 5:37 PM
awight updated the task description. (Show Details)
awight set Security to None.
atgo added subscribers: CaitVirtue, RLewis, atgo.

@RLewis @CaitVirtue have you ever run into this?

Marking as low priority unless our users are running into the problem.

@atgo yes this is something I have run into when I hand enter donations in Civi, it isn't a huge issue now I know why this happens.

atgo renamed this task from Stray comma causes all kinds of failures to Stray comma causes all kinds of failures in Civi records.Jul 31 2015, 9:11 PM

I tried to replicate this on 4.6 staging (primarily to test 4.6) and I couldn't save that data because code has been added to enforce the format is correct.

However, I also tested on http://d46.demo.civicrm.org/ and could not replicate there so I suspect this will be closable after the upgrade

@Eileenmcnaughton there's a "merge duplicates in" button in the task
options so you can collapse them.

@awight thought these weren't duplicates for reasons?