Пишу модуль для парсинга rss. Всё работает, и ссылка ЧПУ получается но выдаёт два warninga.
Warning: Illegal offset type in isset or empty in pathauto_cleanstring() (line 180 of /home/dev/public_html/sites/all/modules/pathauto/pathauto.inc).
Warning: Illegal offset type in pathauto_cleanstring() (line 223 of /home/dev/public_html/sites/all/modules/pathauto/pathauto.inc).
вот функция сохранения ноды
function _wfp_rssparse_savenode($data){
$node = new stdClass();
$node->type = 'wbf_rssparse';
$node->language = LANGUAGE_NONE;
node_object_prepare($node);
$node->title = (empty($data['title'])?'title':$data['title']);
$node->status = 1;
$node->comment = 0;
$node->promote = 0;
$node->moderate = 0;
$node->sticky = 0;
$node->uid = 1;
$node->path['pathauto'] = true;
$node->field_link_rss['und'][0]['value']= $data['link'];
$node->body['und'][0]['format'] = 'full_html';
$node->body['und'][0]['value'] = $data['body'];
// save image
if(isset($data['img_src'])){
$file_path = $data['img_src'];
$basename = basename($file_path);
if (strrpos($basename, '.')!==false ) {
$file_extension = substr($basename, strrpos($basename, '.')+1);
} else {
$file_extension = '';
}
//take directory, if it doesn't exist then create one
$real_url = file_destination("public://images/test.txt", FILE_EXISTS_REPLACE);
$real_dir=drupal_dirname($real_url);
if(!is_dir($real_dir)){
if(mkdir($real_dir,0777)){
drupal_set_message(t("Folder '!name' create",array('!name'=>$real_dir)));
}else{
drupal_set_message(t("Error create folder: ").$real_dir, 'error');
}
}
//declare filepath and filename
$destination = 'public://images/logo_'. str_replace('-', ' ', $node->title) .'.'.$file_extension;
$file_temp = file_get_contents($file_path);
$file = file_save_data($file_temp, $destination);
if ($file) {
$node->field_image_rss[LANGUAGE_NONE][] = (array)$file;
}
}
node_submit($node);
node_save($node);
}
Кто-нибудь сталкивался с этим ?