Uploaded image for project: 'CiviCRM'
  1. CiviCRM
  2. CRM-14379

Fatal error is thrown when trying to delete price field option

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Minor
    • Resolution: Fixed/Completed
    • Affects Version/s: 4.3.8, 4.4.0, 4.4.3, 4.4.4
    • Fix Version/s: 4.4.5
    • Component/s: CiviContribute
    • Labels:

      Description

      When trying to delete a price field option, a fatal error is thrown. Backtrace shows the error arises from
      civicrm\CRM\Price\Form\Option.php(97): CRM_Core_DAO::getFieldValue("CRM_Price_DAO_PriceSet", NULL, "extends", "id")

      Here the NULL value was supposed to be the property _sid which from the code I am assuming the price set ID. Upon further inspection, it seems this property is not populated for DELETE action, only for UPDATE/VIEW/ADD as evident in CRM\Price\Form\Option.php lines 152-159.

      I have tested the above mentioned versions where this issue exists. Last version I tested that does not have this issue 4.2.13 where it seems the _sid property is not added in class CRM_Price_Form_Option.

      Steps to reproduce the issue:
      1. Create a price set with a select/radio type price field.
      2. Add at least 1 option in the price field.
      3. From the price field page, go to "Edit Price Options" page.
      4. From the option listing, click on the "Delete" link in the "More" expandable menu for the created price field option.

        Attachments

          Activity

            People

            • Assignee:
              dgg David Greenberg
              Reporter:
              shoeb Shoeb Ahmed Sabur
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: