CRM-7785 Participant import issues

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Minor
    • Resolution: Fixed/Completed
    • Affects Version/s: 3.4.alpha
    • Fix Version/s: 3.4.beta
    • Component/s: CiviEvent
    • Labels:
      None

      Description

      A couple of issues with participant import:

      1. The docs say that Participant Role is required, while a role-less import works (role ends up being Attendee).
      2. An attempt to import with status Attended ends up with the status being set to Registered.


      1. Fix onscreen help text (done) to say that participant role is not required, and the event default role will be set if role isn't passed.
      2. Fix status import so it assigns the proper status.

        Attachments

        1. participant.csv
          0.1 kB
          Piotr Szotkowski
        2. Picture 88.PNG
          41 kB
          David Greenberg

          Activity

          [CRM-7785] Participant import issues
          Piotr Szotkowski added a comment -

          Fixed in r33329.

          David Greenberg added a comment -

          Not sure how you tested this, but it's not working for me. Used your participant.csv file and it imported the participant record and set the status to Registered (not Attended). I've attached a screenshot of my field mapping.

          Also, Kurund and I looked at the fisheye diff and the way the code is written won't work for multi-lingual sites.

          David Greenberg added a comment -

          Import field mapping for failed test.

          Piotr Szotkowski added a comment -

          Ok, I think I fixed it this time properly in r33362 (apologies for the earlier fix; I had an existing participation with Attended that I thought I deleted - which I didn't - and then mistook for a fixed case).

          A couple of comments:

          1. I fixed the API 2 massaging code used, as it's the point which translates, say, participant_role to participant_role_id, so I followed suit. The logic handling role is not ideal, but I'd rather not fix it at this point; we want API 2 frozen and minimise changes to it.

          2. The code for handling participant_status_id is broken - it will only work if participant_status_id has the status's label, and breaks if someone passes the actual id. I carefully fixed it in r33366 in a way that it works when an id is passed and has a fallback when a label is passed, but might break if someone uses digit-starting labels (PHP will happily treat if ((int) '2foo')) as true). Still, I think it's better than broken import (even if it breaks some edge cases in API), but please do review.

          Finally, can you elaborate on why you think it wouldn't work on multilingual installs? The SELECT id FROM civicrm_participant_status_type WHERE label = %1 query should work just fine (it'll get rewritten on-the-fly to use the current locale's civicrm_participant_status_type_xx_YY view, which then would look up the localised label).

          David Greenberg added a comment -

          Yikes - this is STILL not working. Used your single row file on a brand newly reloaded 3.4 DB w/ latest svn/trunk Revision: 33460 and the imported participant record wound up w/ Status = Registered (s/b Attended).

          Piotr Szotkowski added a comment -

          Aaargh, another place was happily ignoring participant_status_id and setting status_id to 1. I don't know why it seemed to work for me previously; maybe caching issues. :|

          I triple checked this time, resetting my install between checks, so hopefully fixed in r33464.

            People

            • Assignee:
              David Greenberg
              Reporter:
              Piotr Szotkowski

              Dates

              • Created:
                Updated:
                Resolved: