http://drupal.org/node/26704
If mailhandler is trying to send email to a flexinode, there is no way for the flexinode to know which field or text area to put the content into and just produces a node with no content.

CommentFileSizeAuthor
#5 bodyfield.patch623 bytessethcohn

Comments

sethcohn’s picture

bump.

Just got bit with this...

What's a good fix?

$node->body

is the wrong thing, so what's the right thing, assuming a textarea exists in the flexinode?

I tried this:

  $node->body = implode("\n", $tmp);
  if ($node->type == "flexinode-2") {
          $node->flexinode_2 = implode("\n", $tmp);
  }

(flexinode_2 is the text area in that flexinode I want to populate.

Didn't work... what will?

sethcohn’s picture

Project: Flexinode » Mailhandler

Refiling this against Mailhandler.... it's not really a flexinode problem, as mailhandler needs to handle the special case of flexinodes better.

moshe weitzman’s picture

Status: Active » Closed (won't fix)

not a mailhandler issue. you solve this by using Commands feature of mailhandler and creating a flexinode_mailhandler() function.

sethcohn’s picture

Status: Closed (won't fix) » Active

figured out why the above code didn't work:
you must also have set ctype_id (=2 e.g.) as well as node type (flexinode-2 e.g) in the mailhandler configuration.

That likely IS something flexinode should fix, and I'll file a bug against it. This bug is still valid: mailhandler needs to allow pointing 'body' content to a different field if desired. I'll submit a patch to do add a command to do so.

sethcohn’s picture

Component: Miscellaneous » Code
Assigned: Unassigned » sethcohn
Category: bug » feature
Status: Active » Needs review
StatusFileSize
new623 bytes

Patch enclosed...

Command syntax:

bodyfield: new fieldname to copy body contents into.

example:

bodyfield: flexinode_2

This will copy $node->body's content to $node->flexinode_2, allowing population of the desired textarea for example.

This patch does not clear $node->body's content (only copy it to the new field), I can't see any reason to at this time.

moshe weitzman’s picture

Status: Needs review » Closed (works as designed)

modules that need to copy body text can do so in the mailhandler hook. please look at that hook and state why the hook isn't sufficient when filing these integration issues.