I cannot get my feed items to inherit my feed's input format. i am having to go in and manually change them to php filter to get my images to show, how might i get around this?

Comments

alex_b’s picture

Title: Feeds items are not inheriting my feed's input format » Specify input format for feed items
Category: support » task

This is a feature request. Currently there is no way of specifying the input format to use when creating feed items.

and manually change them to php filter

For the record: this sounds dangerous. In case you are aggregating from a source that is not 100 % under your control and to be trusted, importing into nodes that have the PHP filter enabled per default is a *serious* security risk.

netentropy’s picture

oh yeah, i know and would never do it on a live site, i was just testing this module and the only defualt format that would allow the images to show from the RSS was PHP

tstackhouse’s picture

Subscribing. This was a feature in FeedAPI that I'm sorely missing as I used it to pull twitter posts and use a custom input format to link twitter @usernames and #hashtags.

cglusky’s picture

Thought I might have been going crazy(er). +1 on the use case for specifying input formats. I was using the filter from the Twitter module with FeedAPI.
R,
C

cglusky’s picture

Title: Specify input format for feed items » Port from FeedAPI: Specify input format for feed items

Tried using Better Formats module to see if it would pick up the feed item node type defaults for programatically created nodes from Feeds - It does not work.

This is a really handy feature so hope to see it get ported from FeedAPI

alex_b’s picture

If somebody wants to run with this, I am available for providing guidance. Find me on irc.freenode.net #drupal.

cglusky’s picture

Have this done and doing a bit of testing. Will upload patch shortly.

cglusky’s picture

Version: 6.x-1.x-dev » 6.x-1.0-alpha13
Assigned: Unassigned » cglusky
Category: task » feature
Status: Active » Needs review
StatusFileSize
new1.63 KB

Here's a patch against alpha13. I just took some of the code from FeedAPI and moved it over with a few additional lines to address Feeds architecture.

Lightly tested using a Twitter feed with Twitter modules filter.

Not sure if "Default format" will work with the per content type input format defaults set by a module like Better Formats, since Drupal core takes a more global approach to default input formats.

alex_b’s picture

This is looking very good. I'm not worried about 'Better Formats' integration. If it is desired, we should break it out into a separate issue.

cglusky’s picture

Version: 6.x-1.0-alpha13 » 6.x-1.0-alpha14

@alex_b would you prefer i keep this patch up to date for latest alpha/beta releases or just change it to dev?

alex_b’s picture

Version: 6.x-1.0-alpha14 » 6.x-1.x-dev

Patches always go against dev... should just apply.

mcarbone’s picture

Patch works great for me.

alex_b’s picture

Status: Needs review » Needs work
StatusFileSize
new1.88 KB

Tested, this works nicely. Tweaked UI text and rerolled against head.

We need a minimal test for this though. Can be part of the last block in FeedsRSStoNodesTest::test() starting with "Now create a second feed configuration that is not attached to a content".

Just set a filter input format on the importer before importing and double check the filter format on a feed item node.

cglusky’s picture

Hmm. Never written a test. I will have a look and see if it's something I can pull off without hurting myself...

I stole the full_html_format query from some other tests and the rest of it from one of your tests. Have no idea if this would work. As usual, I know just enough to be dangerous.

// Set input format and import feed file.
    $full_html_format = db_query_range('SELECT * FROM {filter_format} WHERE name = :name', 0, 1, array(':name' => 'Full HTML'))->fetchObject();
    $this->setSettings('syndication_standalone', 'FeedsNodeProcessor', array('input_format' => $full_html_format));
    $feed_url = $GLOBALS['base_url'] .'/'. drupal_get_path('module', 'feeds') . '/tests/feeds/developmentseed_changes.rss2';
    $this->importURL('syndication_standalone', $feed_url);
    $this->assertText('Input format set');
alex_b’s picture

Here is a tutorial for writing tests - http://drupal.org/node/395012 . Writing tests is really simple, judging from what I'm seeing in #8 you can do it :-)

cglusky’s picture

@alex_b,
sorry for the delayed reply. been on the road and not sure where all my d.o. email is disappearing to...

let me have a look at that link you gave and see about getting smarter on simple tests.

r,
c

cglusky’s picture

Assigned: cglusky » Unassigned

Sorry, i am about to get blasted by another project and do not want to lead anyone on .. i am not going to have time to figure out how to write a simple test for this. again sorry.
R,
C

seanberto’s picture

StatusFileSize
new1.94 KB

Looks like this patch needs to be rewritten just a bit for 6.x-1.0-beta1.

alex_b’s picture

Issue tags: +Needs tests

#18: thanks.

jeffschuler’s picture

Status: Needs work » Needs review
StatusFileSize
new4.29 KB

Re-roll for changes that just came out in 6.x-1.0-beta2, plus some simple [simple]tests.

Feedback appreciated!

alex_b’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new4.48 KB

Thank you!

Minor adjustment to UI, some periods on comments: RTBC.

alex_b’s picture

Status: Reviewed & tested by the community » Fixed

All tests passing. Committed. Thank you again.

http://drupal.org/cvs?commit=391024

cglusky’s picture

@jeffschuler thanks for picking up my simple test slack!

Status: Fixed » Closed (fixed)
Issue tags: -Needs tests

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