Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

5.10 #13501

Merged
merged 2 commits into from
Jan 27, 2019
Merged

5.10 #13501

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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