Skip to content

Commit

Permalink
Merge pull request #13501 from civicrm/5.10
Browse files Browse the repository at this point in the history
5.10
  • Loading branch information
eileenmcnaughton authored Jan 27, 2019
2 parents a2aecef + bb50227 commit 8cb0d7d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
4 changes: 1 addition & 3 deletions CRM/Core/DAO.php
Original file line number Diff line number Diff line change
Expand Up @@ -1665,9 +1665,7 @@ public static function &copyGeneric($daoName, $criteria, $newData = NULL, $field
}

if ($newData) {
foreach ($newData as $k => $v) {
$newObject->$k = $v;
}
$newObject->copyValues($newData);
}
}
$newObject->save();
Expand Down
4 changes: 2 additions & 2 deletions CRM/Event/BAO/Event.php
Original file line number Diff line number Diff line change
Expand Up @@ -924,7 +924,7 @@ public static function &getCompleteInfo(
* @return CRM_Event_DAO_Event
* @throws \CRM_Core_Exception
*/
public static function copy($id) {
public static function copy($id, $params = []) {
$eventValues = array();

//get the require event values.
Expand All @@ -947,7 +947,7 @@ public static function copy($id) {
$copyEvent = CRM_Core_DAO::copyGeneric('CRM_Event_DAO_Event',
array('id' => $id),
// since the location is sharable, lets use the same loc_block_id.
array('loc_block_id' => CRM_Utils_Array::value('loc_block_id', $eventValues)),
array('loc_block_id' => CRM_Utils_Array::value('loc_block_id', $eventValues)) + $params,
$fieldsFix
);
CRM_Price_BAO_PriceSet::copyPriceSet('civicrm_event', $id, $copyEvent->id);
Expand Down
2 changes: 1 addition & 1 deletion CRM/Event/Form/ManageEvent/EventInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ public function postProcess() {

// now that we have the event’s id, do some more template-based stuff
if (!empty($params['template_id'])) {
$event = CRM_Event_BAO_Event::copy($params['template_id']);
$event = CRM_Event_BAO_Event::copy($params['template_id'], $params);
}
else {
$event = CRM_Event_BAO_Event::create($params);
Expand Down

0 comments on commit 8cb0d7d

Please sign in to comment.