To me, correct solution looks like to replace this:
$temp['from'] = @(int)$_meta[$field['pk_i_id']]['from'];
$temp['to'] = @(int)$_meta[$field['pk_i_id']]['to'];
With following:
if(is_array($_meta) && isset($_meta[$field['pk_i_id']]) && isset($_meta[$field['pk_i_id']]['from'])) {
$temp['from'] = (int)$_meta[$field['pk_i_id']]['from'];
$temp['to'] = (int)$_meta[$field['pk_i_id']]['to'];
} else {
$temp['from'] = '';
$temp['to'] = '';
}