Hi Ruben,
I was able to fix this issue as follows,
\modules\Events\actions\SaveAjax.php
And change the following class,
/**
* Function to get the record model based on the request parameters
* @param Vtiger_Request $request
* @return Vtiger_Record_Model or Module specific Record Model instance
*/
public function getRecordModelFromRequest(Vtiger_Request $request) {
recordModel = parent::getRecordModelFromRequest(
request);
if ($recordModel->get('mode') == 'edit') { $this->setRecurrenceInfo($recordModel); } $startDate = $request->get('date_start'); if (!empty($startDate)) { //Start Date and Time values $startTime = Vtiger_Time_UIType::getTimeValueWithSeconds($request->get('time_start')); $startDateTime = Vtiger_Datetime_UIType::getDBDateTimeValue($request->get('date_start') . " " . $startTime); list($startDate, $startTime) = explode(' ', $startDateTime); $recordModel->set('date_start', $startDate); $recordModel->set('time_start', $startTime); } $endDate = $request->get('due_date'); if (!empty($endDate)) { //End Date and Time values $endTime = $request->get('time_end'); $endDate = Vtiger_Date_UIType::getDBInsertedValue($request->get('due_date')); if ($endTime) { $endTime = Vtiger_Time_UIType::getTimeValueWithSeconds($endTime); $endDateTime = Vtiger_Datetime_UIType::getDBDateTimeValue($request->get('due_date') . " " . $endTime); list($endDate, $endTime) = explode(' ', $endDateTime); } $recordModel->set('time_end', $endTime); $recordModel->set('due_date', $endDate); } $activityType = $request->get('activitytype'); $visibility = $request->get('visibility'); if (empty($activityType)) { $recordModel->set('activitytype', 'Task'); $visibility = 'Private'; $recordModel->set('visibility', $visibility); } if (empty($visibility)) { $assignedUserId = $recordModel->get('assigned_user_id'); $sharedType = Calendar_Module_Model::getSharedType($assignedUserId); if ($sharedType == 'selectedusers') { $sharedType = 'public'; } $recordModel->set('visibility', ucfirst($sharedType)); } $setReminder = $request->get('set_reminder'); if ($setReminder) { $_REQUEST['set_reminder'] = 'Yes'; } else { $_REQUEST['set_reminder'] = 'No'; } return $recordModel;}
@mirza.mehran I cannot see what you have changed. Please could you post a diff or just show the lines you edited?
@vtiger This error occurs on demo.vtiger.com as well.
I suspect the error is from the getRecordModelFromRequest() method of the parent class: Calendar_Save_Action.
It doesn't seem to check if the $request object contains any of the start or end date time values before resetting the values in the $recordModel object:
Am not sure if this is quite correct but wrapping the start and end date code blocks in if statements seems to work for setting the Event Held from the Summary View widget...
if($request->get('time_start')){//Start Date and Time values$startTime=Vtiger_Time_UIType::getTimeValueWithSeconds($request->get('time_start'));$startDateTime=Vtiger_Datetime_UIType::getDBDateTimeValue($request->get('date_start')." ".$startTime);list($startDate,$startTime)=explode(' ',$startDateTime);$recordModel->set('date_start',$startDate);$recordModel->set('time_start',$startTime);}if($request->get('time_end')){//End Date and Time values$endTime=$request->get('time_end');$endDate=Vtiger_Date_UIType::getDBInsertedValue($request->get('due_date'));if($endTime){$endTime=Vtiger_Time_UIType::getTimeValueWithSeconds($endTime);$endDateTime=Vtiger_Datetime_UIType::getDBDateTimeValue($request->get('due_date')." ".$endTime);list($endDate,$endTime)=explode(' ',$endDateTime);}$recordModel->set('time_end',$endTime);$recordModel->set('due_date',$endDate);}