CRM-14069 Allow setting event price set ids by api

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Minor
    • Resolution: Fixed/Completed
    • Affects Version/s: 4.4.3
    • Fix Version/s: 4.5
    • Labels:
      None

      Description

      At the moment it's not currently possible to create an event with a linked price set via the api. I propose event.create accept price_set_id as a pseudoparam & further that we define the metadata such that is converted into an array by the api wrapper - this will mean adding something to our metadata definition

        Attachments

          Issue Links

            Activity

            [CRM-14069] Allow setting event price set ids by api
            Joe Murray added a comment -

            I think our discussions have moved us towards the approach of calling a new higher level, more encompassing api, currently still called contribution.create, that would do the financial stuff as well as create the event participants, using line_items, not price_set_id, as the params: http://forum.civicrm.org/index.php/topic,31242.msg134061.html#msg134061.

            Eileen McNaughton added a comment -

            this ticket & the commit against it is specific to the creation of an event rather than participants - ie, when you set up an event you should be able to link to a price set

            Eileen McNaughton added a comment -

            I've refreshed the PR - I don't think there is any fundamental reason we can't keep this code - the functionality it adds is described here

            + function testCreatePaidEvent()

            { + //@todo alter API so that an integer is converted to an array + $priceSetParams = array('price_set_id' => (array) 1, 'is_monetary' => 1); + $result = $this->callAPISuccess('Event', 'Create', array_merge($this->_params[0], $priceSetParams)); + $event = $this->callAPISuccess('Event', 'getsingle', array('id' => $result['id'], 'return' => 'price_set_id')); + $this->assertArrayKeyExists('price_set_id', $event); + }
            David Greenberg added a comment -

            Event api tests are running w/o error. Event create UI is working as expected.

              People

              • Assignee:
                Yashodha Chaku
                Reporter:
                Eileen McNaughton

                Dates

                • Created:
                  Updated:
                  Resolved: