Currently OPML import uses the TITLE and TEXT attributes of OPML entries as feed title and description.

Adding following form elements

function feedapi_import_feeds_form() {
  ...
  $form['override_title'] = array(
    '#type' => 'checkbox',
    '#title' => t('Use TITLE attribute of OPML entries as feed title'),
    '#description' => t('If checked feed title will be overriden with the information from OPML file'),
  );
  $form['override_body'] = array(
    '#type' => 'checkbox',
    '#title' => t('Use TEXT attribute of OPML entries as feed description'),
    '#description' => t('If checked feed description will be overriden with the information from OPML file'),
  ); 
  ...
} 

and changing the following lines of function _feedapi_import_opml_process()

$node->title = $feed['TITLE'];
$node->body = $feed['TEXT']; 

as follows will allow the user to override the information from feed with information from OPML file.

if ($args['override_title']) {
  $node->title = $feed['TITLE'];
}
if ($args['override_body']) {
  $node->body = $feed['TEXT'];
} 

Apologies for not submitting a patch file today.

CommentFileSizeAuthor
#1 feedapi_opml-override.patch1.7 KBmustafau

Comments

mustafau’s picture

Status: Active » Needs review
StatusFileSize
new1.7 KB

The patch is attached.

summit’s picture

Hi, Will this patch be committed to feedapi 5?
Thanks for considering this! Greetings, Martijn

aron novak’s picture

Status: Needs review » Fixed

Thanks a lot, useful and correct patch! It's committed now.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.