Hi,
I'm running OpenAtrium 1.3 with CaseTracker and MailComment 6.x-2.2. I've got everything working fine and the mail is flowing. The only issue I'm facing is that when a comment is imported, due to the way CaseTracker works the import is not setting the Driven properties when the comment is created. As a result when you load the case page, the comment is visible, but you get html_special_chars errors since the driven properties in the database are null values.
Now I've isolated the logic down and I need to ensure that when a comment is set using the Feeds importer, the driven properties are also set correctly.
I know exactly what needs to be done and I have a code snippet that is valid if the hook_mailcomment_alter was in place. Since this hook is no longer available in 6.x-.2.2 and there is a relatively cryptic reference that this can be replicate using Feeds hook, I'd appreciate it if someone could tell me how to do it.
The code snippet is as follows (original post: http://drupal.org/node/641974#comment-2306912)
function mailcomment_casetracker_mailcomment_alter(&$node, $op) {
switch ($op) {
case 'pre':
$parent = node_load($node->nid);
$name = db_result(db_query("SELECT name FROM {users} WHERE uid = %d", $parent->casetracker->assign_to));
$node->casetracker->case_priority_id = $parent->casetracker->case_priority_id;
$node->casetracker->case_type_id = $parent->casetracker->case_type_id;
$node->casetracker->assign_to = $name;
$node->casetracker->case_status_id = $parent->casetracker->case_status_id;
$node->casetracker->pid = $parent->casetracker->pid;
return $node;
}
}
Thanks in advance.
Comments
Comment #1
danepowell commentedI would suggest looking in feeds.api.php - I'm guessing the hooks you want are hook_feeds_after_parse() or hook_feeds_after_import(), and there's also hook_feeds_parser_sources_alter(), which mailcomment actually implements.
Alternatively, this might be an issue that you want to attack from the Driven / Case Tracker front - I submitted a patch for Comment Driven along these lines that you might find useful: #825304: Support comments not inserted via FAPI
Comment #2
danepowell commentedGoing to assume you figured this one out.