Comment #7 on issue 2384 by [email protected]: EAD - dates not importing
http://code.google.com/p/qubit-toolkit/issues/detail?id=2384

Unfortunately the issue is more complicated than that - I haven't been able to figure out what combination of existing records triggers the error. But here's how you can replicate the steps I took to do the analysis I reported in commment #2

- import the attached file (note that Simon's file doesn't include correctly encoded creator information, i.e. the way qubit is looking for it, but we need that in order to test).
- it should have worked fine
- now go to the backend database; scroll to the last few records in the event table - check the most recent record where both actor_id and information_object_id is populated; make note of information_object_id - edit the getCreationEvents function to hard-code the ID lookup to that information_object_id - to force a match on the creation events lookup. E.g.:

  public function getCreationEvents()
  {
    $criteria = new Criteria;
    //    $criteria->add(QubitEvent::INFORMATION_OBJECT_ID, $this->id);
    $criteria->add(QubitEvent::INFORMATION_OBJECT_ID, "817");

- now re-import the same file
- this time, the dates should not have imported
- now tweak the setDates function to change the $save call:

    if (count($creationEvents = $this->getCreationEvents()) > 0)
    {
      $event = $creationEvents[0];
      $event->setIndexOnSave(false);
      $event->setStartDate($normalizedDate['start']);
      $event->setEndDate($normalizedDate['end']);
      $event->setTypeId($eventTypeId);
      $event->setDate($date);
      //      $event->save();
      $this->events[] = $event;
    }

- and re-import the same file
- this time the date should have imported, but linked to the creator record

So two things seem to be happening:
- under normal circumstances, the dates don't get linked to the creator record, at least if the creator was added during the same import routine - if there *is* a match on the creation event, the date linking routine doesn't seem to be working

Attachments:
        SSUA-164.xml  4.5 KB

--
You received this message because you are subscribed to the Google Groups "Qubit 
Toolkit Issues" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/qubit-issues?hl=en.

Reply via email to