Merge branch 'fronkdev' into 'master'
Fixed bug which prevented Preorder::afterSave() from running See merge request fronk/thetool!87
This commit is contained in:
@@ -20,7 +20,8 @@ class Preorder extends mfBaseModel {
|
||||
}
|
||||
|
||||
public function afterSave() {
|
||||
if(!$this->in_after_save) return true;
|
||||
// prevent potential infinite loop
|
||||
if($this->in_after_save) return true;
|
||||
$this->in_after_save = true;
|
||||
// update preorder OAID if it's different from the unit OAID
|
||||
// but only if the unit OAID is of the same origin as the campaign
|
||||
@@ -34,6 +35,7 @@ class Preorder extends mfBaseModel {
|
||||
|
||||
public function setOrCreateOaid($oaid_attributes = false) {
|
||||
$campaign = new Preordercampaign($this->preordercampaign_id);
|
||||
//var_dump($campaign);exit;
|
||||
if(!$campaign->id) {
|
||||
return false;
|
||||
}
|
||||
@@ -53,6 +55,7 @@ class Preorder extends mfBaseModel {
|
||||
}
|
||||
} elseif($campaign->oaid_origin == "ofaa") {
|
||||
$current_oaid = OpenAccessIdModel::getFirstOaid($this->oaid);
|
||||
//var_dump($current_oaid);exit;
|
||||
if(!$current_oaid) {
|
||||
$this->log->error("OAID of Preorder ".$this->id." not found in OpenAccessIds");
|
||||
// assume it's from a different origin
|
||||
|
||||
Reference in New Issue
Block a user