I solved the bug and my work is done here(I hope) . Please test and report any bugs.
So in oc-includes/osclass/frm/Field.form.class.php
I put:
static public function meta($field = null, $search = false) {
if($field!=null) {
// date interval
if($field['e_type']=='DATEINTERVAL') { $type='DATEINTERVAL';
/* $field['s_value'] = array();
$field['s_value']['from'] = '';
$field['s_value']['to'] = '';*/
if(!$search) {
$aInterval = Field::newInstance()->getDateIntervalByPrimaryKey($field['fk_i_item_id'], $field['pk_i_id']);
if(is_array($aInterval) && !empty($aInterval) ) {
$temp['from'] = @$aInterval['from'];
$temp['to'] = @$aInterval['to'];
$field['s_value'] = $temp;
}
} /*else {
$temp['from'] = Params::getParam('meta['.$field['pk_i_id'].'][from]');
$temp['to'] = Params::getParam('meta['.$field['pk_i_id'].'][to]');
$field['s_value'] = $temp;
}*/
}
// end date interval
if(Session::newInstance()->_getForm('meta_'.$field['pk_i_id']) != ""){
$field['s_value'] = Session::newInstance()->_getForm('meta_'.$field['pk_i_id']);
} else if(!isset($field['s_value']) || $field['s_value']=='') {
$s_value = Params::getParam('meta');
$field['s_value'] = '';
if(isset($s_value[$field['pk_i_id']])) {
if($search) {
if($field['e_type']=='NUMERIC') {
$tmp['from'] = $s_value[$field['pk_i_id']]['from'];
$tmp['to'] = $s_value[$field['pk_i_id']]['to'];
$field['s_value'] = $tmp;
} else {
$field['s_value'] = $s_value[$field['pk_i_id']];
}
} else {
$field['s_value'] = $s_value[$field['pk_i_id']];
}
}
}
instead of
static public function meta($field = null, $search = false) {
if($field!=null) {
// date interval
if($field['e_type']=='DATEINTERVAL') {
$field['s_value'] = array();
$field['s_value']['from'] = '';
$field['s_value']['to'] = '';
if(!$search) {
$aInterval = Field::newInstance()->getDateIntervalByPrimaryKey($field['fk_i_item_id'], $field['pk_i_id']);
if(is_array($aInterval) && !empty($aInterval) ) {
$temp['from'] = @$aInterval['from'];
$temp['to'] = @$aInterval['to'];
$field['s_value'] = $temp;
}
} else {
$temp['from'] = Params::getParam('meta['.$field['pk_i_id'].'][from]');
$temp['to'] = Params::getParam('meta['.$field['pk_i_id'].'][to]');
$field['s_value'] = $temp;
}
}
// end date interval
if(Session::newInstance()->_getForm('meta_'.$field['pk_i_id']) != ""){
$field['s_value'] = Session::newInstance()->_getForm('meta_'.$field['pk_i_id']);
} else if(!isset($field['s_value']) || $field['s_value']=='') {
$s_value = Params::getParam('meta');
$field['s_value'] = '';
if(isset($s_value[$field['pk_i_id']])) {
$field['s_value'] = $s_value[$field['pk_i_id']];
}
}
I also edited my above post.