Skip to content

Commit

Permalink
Merge pull request #168 from Jako/patch-1
Browse files Browse the repository at this point in the history
Invoke OnDocFormSave event
  • Loading branch information
goldsky committed Oct 20, 2018
2 parents efe6a44 + b32031e commit 8e7e6f5
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions core/components/babel/model/babel/babel.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,13 @@ public function duplicateResource(&$resource, $contextKey)
$newParent->save();
}
}

/* invoke OnDocFormSave event */
$this->modx->invokeEvent('OnDocFormSave', array(
'mode' => modSystemEvent::MODE_NEW,
'id' => $newResource->get('id'),
'resource' => &$newResource
));
} else {
$this->modx->log(modX::LOG_LEVEL_ERROR, 'Could not duplicate resource: '.$resource->get('id').' in context: '.$contextKey);
$newResource = null;
Expand Down

0 comments on commit 8e7e6f5

Please sign in to comment.