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

handle better default values for api.email.create api.phone.create

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Trivial
    • Resolution: Fixed/Completed
    • Affects Version/s: 4.2.0
    • Fix Version/s: 4.2.0
    • Component/s: None
    • Labels:
      None

      Description

      (for the sprint, if you get enough help).

      When we changed from "custom dublicated boilerplate" to use the create_basic, worked nicely but lost a few things on the way:

      1) if you create a email without is_primary set in the param, it should default to 1 if it's the 1st email, 0 otherwise
      2) the location_type_id is (I think) not defaulting to the default location
      3) the validation on the email is skipped (or 'aaa' became a valid email recently)

      The 1) is important to make the api easier to consume, 2) is a nice to have

      3) brings the question of how to refactor and move the validation in the form to the BAO, that might be complex (eg that'd be dumb to do the validation both on the form.validate AND in the BAO create/add/save/whatever the name chosen). May be splitting that into a BAO::validate function that can be called both from the API & the form

      X+

      Probably something to discuss at the sprint

        Attachments

          Activity

            People

            • Assignee:
              eileen Eileen McNaughton
              Reporter:
              xavier xavier dutoit
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: