DataObjects/Events.php
authorEdward <edward@roojs.com>
Tue, 28 Apr 2015 07:42:30 +0000 (15:42 +0800)
committerEdward <edward@roojs.com>
Tue, 28 Apr 2015 07:42:30 +0000 (15:42 +0800)
DataObjects/Events.php

index d1cbbac..48bd9c3 100644 (file)
@@ -307,6 +307,10 @@ class Pman_Core_DataObjects_Events extends DB_DataObject
             $this->person_id = 0;
         } else {
             $col = $au->tableName() == "Person" ? 'person_id' : $au->tableName() . '_id';
+            // does $col exist?
+            $cols = $this->table();
+            $col = isset($cols[$col]) ? $col : 'person_id'; // for BC....
+            if ($this->table())
             $this->{$col} = $au->pid();
             //$this->person_id = $au ? (!empty($au->id) ? $au->id : $au->pid()) : -1;
         }