Ok so while I was waiting for a possible implementation from the mailhandler devs, I was playing around with the code myself to try and make a new node create a menu link called the same as it's title. The code is entering the menu title in (I can see this when I go to edit node after it's created) but it is not creating the menu link as it doesnt seem to want to associate with any menu. I've attached a copy of what I did so hopefully someone can point out my (probably stupid) mistake.
File: mailhandler.retrieve.inc
Start Line: 334
Code:
// decode encoded subject line
$subjectarr = imap_mime_header_decode($header->subject);
for ($i = 0; $i < count($subjectarr); $i++) {
if ($subjectarr[$i]->charset != 'default')
$node->title .= drupal_convert_to_utf8($subjectarr[$i]->text, $subjectarr[$i]->charset);
else
$node->title .= $subjectarr[$i]->text;
$node->menu[link_title] .= $subjectarr[$i]->text;
$node->menu[parent] .= 'primary-links:0';
}
Comments
Comment #1
acecombat commentedAfter playing around with it a little more it is creating a menu link, however it is only putting it under the "Primary Links" section regardless of what I put in the ' ' on the second last line. Any idea what I might be doing wrong??? I've tried:
$node->menu[parent] .= 'navigation:0';
$node->menu[parent] .= '';
$node->menu[parent] .= 'Navigation';
Comment #2
z.stolar commented@acecombat: I'm sorry, but I'm not going to relate to the actual code, but to your approach:
a. You duplicated an issue (#506164: Add a hook to mailhandler, to be invoked after node save)
b. You are changing mailhandler's code in a way that will prevent you from updating the module in the future. Please use the support forums/lists for such questions.