Closed (outdated)
Project:
Feeds
Version:
7.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
17 Jun 2011 at 01:06 UTC
Updated:
16 May 2025 at 22:28 UTC
Jump to comment: Most recent
Which doesn't make sense as most feeds contain HTML, so this should default to using the filtered_html input format. And the importer should also probably store its format value by format machine name and not format ID.
Comments
Comment #1
aangel commentedI'm encountering this as well and here is my workaround:
Comment #2
lawnmower528 commentedWhere did you place this patch? Could you provide a .patch file?
Comment #3
aangel commentedWell, now I'm no longer sure that the module isn't working as designed and I won't be looking into it again today. If you find that the text format setting isn't working for you, place code similar to the above in a custom module (it's not a modification to existing code, it's brand new code):
Creating Drupal 7.x modules
For a single feed you can get away with just the following:
Clear your cache and then every time the feed node is about to be saved the format will be set to 'full_html.'
Here is the documentation on Drupal 7 hooks:
http://api.drupal.org/api/drupal/includes--module.inc/group/hooks/7
Comment #4
hellomobe commentedAnother solution is to use the check_markup() on the field output (I placed it in the node.tpl file).
Comment #5
irwin nerwin commentedMy inner hacker wanted to try the code posted above, for a single feed. (Thanks for the tip to Creating Drupal 7.x modules. I think.) The Creating D7 Modules article was clear and easy to follow. I created and enabled my first module! It didn't change anything. Maybe didn't do anything. But OTOH, it didn't break anything either! So, that was exciting. Perhaps I have done something wrong. Perhaps I have the whole source of the problem wrong! But I learned to create a module, even if it didn't do anything. Hacker thrills.
Edited to remove earlier idiotic ramblings and leave the following revised idiotic ramblings.
In case anyone else needing to know might stumble on this: With CSV (or TSV) files, one puts "double-quote marks" around textish fields, and one doubles-up any double-quotes inside the field. Yeah, I used to know that. Now I know it again.
"Hi, I'm a field value."and"""Hi,"" she said. ""I'm a field value."""Also helps if editing the file with, say, Notepad, to save as utf-8 instead of ANSI. Thanks to the developers for the Feeds module, which works fine… once the data is formatted correctly!]Comment #6
dooug commentedI think this no longer applies (or at least the work-arounds aren't necessary) because you can set the text format on the Node processor settings and (depending on the parser you are using, I am using querypath) you can choose "Select the queries you would like to return raw XML or HTML " for fields targets on the import form.
Comment #8
kpv commented+1. at least for Body field your can set text format
Comment #9
giorgio79 commentedHow do I set the input format for text fields other than the body?
Comment #10
tondeuse commentedThanks so much, Dave Reid for this little hack, it saved me a ton of time on a large imported database with a long array of fields.
Here is my take on your suggestion, the big change here is that I validate that no row is created in the affected tables in the DB, as $node->body['und'][0]['format'], actually creates a record in the table.
A dsm($node) shows that format is a child of [0], just as well as the child value. The following code checks that [0] exists (therefore has children) before format asignation. It also takes into account that for repeatable fields, the [0] could become one [1] and so on, using deltas.
As my content type contained a field collection with 3 fields, not affected by the node_presave process, I completed the job hitting the db directley with a query to wrap it up. (see comments)
Comment #11
twistor commentedHijacking your issue :)
As far as I can gather, this only applies to the "Feeds News" feature. Feeds currently stores filter formats by machine name.
Will depend on #1588938: Allow selection of filter for each text field imported.
Comment #12
eriknewby commentedIf you copy paste the block above (comment #3), make sure you take a look at your node object. In my case, my "body" field is actually "field_feed_item_description".
Thanks for sharing aangel.
Comment #13
ibar commentedThe input format can be set on the Processor settings page as noted in #6 but since the upgrade to feeds-7.x-2.0-alpha6 it doesnt work any more. Although I have set it to Filtered HTML it imports the body of the node in plain text, so in order to work I have to open the created node and resave it.
Is there a fix for this?
Comment #14
aangel commented