Closed (fixed)
Project:
Import HTML
Version:
5.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
2 May 2007 at 22:29 UTC
Updated:
16 May 2010 at 17:27 UTC
I'm currently testing import into a CCK type node that has no "body" field. However, my imported nodes all have a body and teaser fields containing the text: "PLACEHOLDER. CCK needs no body."
How about checking for this and deleting it before node_save?
Or (even better) allowing body to be empty (i.e. not setting an error and failing) if it is a CCK type node?
Comments
Comment #1
dman commentedYeah. That's a limitation from pre-cck days.
I also want to support other node types that may or may not require body. I'm thinking that now that FAPI allows submission from code I should try passing the node creation through that, and allow the FAPI validate to catch all the errors. That would be a bit of surgery however.
Currently I'm doing it by hand at the bottom of _import_html_import_files()
Which is awkward and possibly redundant.
I may try the FAPI validate callback there instead, but I'm concerned that may throw up other complaints - like for undefined required fields or terms - which I've currently been happy to ignore. Because that's easiest.
Either validate fully or use the above cheapo attempt. It's tricky.
Comment #2
leeksoup commentedI did a simple patch to my copy to make this work. Since the $node->body and teaser are set to placeholder only in the case of a CCK node, it should work for all such nodes. It does work for mine.
Anyway, here's the diff:
Now I don't get junk body and teaser fields on all my imported nodes. :-)
Comment #3
dman commentedCleaning up issue queue by closing stuff from the Drupal-5 branch and over a year old.
(This is supported in D6 version)