CRM-10326 Extraneous civicrm_price_set_entity rows created when submitting online contribution / membership signups

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Minor
    • Resolution: Fixed/Completed
    • Affects Version/s: 4.2.0
    • Fix Version/s: 4.2.0
    • Component/s: CiviContribute, CiviMember
    • Labels:
      None

      Description

      My understanding is that the purpose of the price_set_entity table is to link online contribution pages to price sets, and events to price sets. The sample data properly contains rows which do this for the 3 sample online contribution pages, and the 3 sample events.

      However, I am seeing sample data rows AND new rows created in this table linking price sets to specific contribution records. I don't understand why this would be needed - AND the insert behavior is inconsistent. If there's some reason we need these entries in price_set_entity - let's discuss please.

      BUG 1: There are additional entries in the sample data linking price set 1 to each of the 13 sample contribution records.

      BUG 2: When I make an online contribution (using sample contribution pages) - a new row is inserted in civicrm_price_set_entity linking the contribution page's price set to the contribution. Why is this needed? Note that rows are NOT inserted into this table for any of these other actions:

      • offline contribution (quick config)
      • online event registration (quick config)
      • offline event registration (quick config)
      • online or offline event registration (explicit price set)

        Attachments

          Activity

          [CRM-10326] Extraneous civicrm_price_set_entity rows created when submitting online contribution / membership signups
          Joe Murray added a comment -

          Having thought about this more, I would like to us to be consistent in not creating these entries. Please change the code so that we do not create them either in the sample data or when recording payments of any kind.

          Pradeep Nayak added a comment -

          Joe.
          Bug 1. we create entries in civicrm_price_set_entity when we have contribution recorded
          through price set, and also we had agreed upon creating entry for participants also. Now the sample contribution data is stored as line item so a new entry is also created in civicrm_price_set_entity for all participants and contributions.

          BUG 2: If i dont allow entries civicrm_price_set_entity for quick config then the code wont track which price set is being used in line items, contribution_page and event.

          I can restrict the entries in civicrm_price_set_entity for quick config but il need to change the Price/BAO/Set.php getUsedBy function so it will also check in civicrm_line_item whether any fields or field values is being used and restrict deletion of price_set, price_field, price_field_value.

          Joe Murray added a comment -

          When I installed 4.1.3 there were no entries in civicrm_price_set_entity. When I then followed instructions at http://wiki.civicrm.org/confluence/display/CRMDOC41/Installing+CiviCRM+from+subversion+%28SVN%29+repository to install from subversion v4.2 branch as updated to r41040, and ran bin/setup.sh to regenerate the database, I got 13 records pointing to contributions and 11 to participant records. Please fix.

          Pradeep Nayak added a comment -

          committed the latest civicrm_generated.mysql at revision 41063 and also committed the changes.

            People

            • Assignee:
              David Greenberg
              Reporter:
              David Greenberg

              Dates

              • Created:
                Updated:
                Resolved: