When I create a new Feeds Importer there is no place to enter a URL for the feed if I select a content type other than Standalone Form. I have tried to create "feed" content but this does not show up in the content type selection box. This makes sens because its not a content type. I tried to edit an existing cck content type to see if I could add the URL there but it does not display.

The url field does not show up under "fetchers" nor under "basic settings". I tried this in chrome and firefox just to be sure it wasn't a javascript oddity.

Comments

rplescia’s picture

Sub - I have the same issue

flatline2010’s picture

Sub - I have the same issue

flatline2010’s picture

Ooops,

I think that we get the URL field when we actually 'import' the RSS:

www.yourdomain.com/import

If, for instance, we attached the imported RSS to the blog message type, when we select it, we will see that it has an additional tab Feed with the URL field ...

Upon creation of the blog message, the items from the RSS will be imported. We can then delete all of them by editing the blog entry created with ../import

Melissamcewen’s picture

same here...feed content type is useless

altrugon’s picture

I found the problem on:

function feeds_get_importer_id($content_type) {
  $importers = array_flip(_feeds_importer_digest());
  return isset($importers[$content_type]) ? $importers[$content_type] : FALSE;
}

Because all the items are enabled on page /admin/build/feeds and there is not save button to re-submit the form, $importers is an empty array and we get nothing from the function above.

A temporary solution:

Disable the Feed item, let the form get submitted, and when it's done enabled the Feed item back. Then you can go to /node/add/feed and you will see the missing Feed fieldset with the URL: field inside.

davidtrainer’s picture

Status: Active » Fixed

To clarify, refresh the Feed Importers page at admin/build/feeds and make sure the "Feeds" Importer is enabled. Then clear your cache and create a new Feed. The input form should now have the URL field.

Status: Fixed » Closed (fixed)

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

codesidekick’s picture

Issue summary: View changes

For anyone else having issues with this note that the URL module does not appear to be supported by Feeds but the Link module does.

risharde’s picture

I seemed to have found a way to get the URL module in Drupal 7 to be compatible with Feeds

Step 1
In the URL module folder, edit the url.info file and add the following line UNDER the 'recommends[] = elements' line
files[] = url.feeds.inc

Step 2
You have to create a file called url.feeds.inc in the URL module folder with the following code (MAKE SURE TO CLEAR CACHE AFTERWARDS BEFORE GOING BACK TO THE FEEDS MODULE)

<?php

/**
 * @file
 * Provides integration with Feeds module (http://drupal.org/project/feeds).
 */

/**
 * Implements hook_feeds_processor_targets().
 */
function url_feeds_processor_targets($entity_type, $bundle) {
  $targets = array();

  foreach (field_info_instances($entity_type, $bundle) as $name => $instance) {
    $info = field_info_field($name);

    if ($info['type'] == 'url') {
      $targets[$name] = array(
        'name' => check_plain($instance['label']),
        'callback' => 'url_feeds_set_target',
        'description' => t('The @label field of the node.', array('@label' => $instance['label'])),
      );
    }
  }

  return $targets;
}

/**
 * Callback to set target value.
 */
function url_feeds_set_target(FeedsSource $source, $entity, $target, array $values, array $mapping) {
  $language = $mapping['language'];

  //This is for the value
  list($field_name, $column) = explode(':', $target . ':value');

  $field = isset($entity->$field_name) ? $entity->$field_name : array($language => array());

  // Iterate over all values.
  $delta = 0;
  foreach ($values as $value) {
    if (is_object($value) && $value instanceof FeedsElement) {
      $value = $value->getValue();
    }

    if (is_scalar($value) && strlen($value)) {
      $field[$language][$delta][$column] = (string) $value;
    }

    $delta;
  }
  $entity->$field_name = $field;

  //This is for the title. It basically takes the value which is the url and also sets it as the title.
  list($field_name, $column) = explode(':', $target . ':title');

  $field = isset($entity->$field_name) ? $entity->$field_name : array($language => array());

  // Iterate over all values.
  $delta = 0;
  foreach ($values as $value) {
    if (is_object($value) && $value instanceof FeedsElement) {
      $value = $value->getValue();
    }

    if (is_scalar($value) && strlen($value)) {
      $field[$language][$delta][$column] = (string) $value;
    }

    $delta;
  }
  $entity->$field_name = $field;
}
?>
hypnoser’s picture

risharde - Thank you very mach! This work!

akharabi’s picture

Thank you, this is very good. I am wondering if you are adding separate URL and Title for the title?