Closed (fixed)
Project:
Mailhandler
Version:
6.x-1.5
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
15 Nov 2008 at 18:22 UTC
Updated:
11 May 2009 at 17:30 UTC
Jump to comment: Most recent file
When submitting a node without commands, comments are off, even if comments have been set to "read/write" in the content type settings page. I don't know if this is done on purpose, but i think that if the node type has comments set to "read/write" by default, submitted nodes that do not have commands should have comments enabled. I think the same applies for other defaults (status, promote, sticky).
Here is a simple fix, that should be added to mailhandler_retrieve_message, before the node is submitted :
$options = variable_get('node_options_'. $node->type, FALSE);
if (is_array($options)) {
$node->status = in_array('status', $options) ? 1 : 0;
$node->promote = in_array('promote', $options) ? 1 : 0;
$node->sticky = in_array('sticky', $options) ? 1 : 0;
}
else {
$node->status = 1;
}
$comment = variable_get('comment_'. $node->type, 0);
$node->comment = $comment;
I can submit a patch if you want.
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | mailhandler_defaults.patch | 827 bytes | jide |
| #2 | mailhandler_defaults.patch | 943 bytes | jide |
Comments
Comment #1
z.stolar commentedPlease submit the patch, it would be of great help!
Comment #2
jide commentedHere we go ! Here is an attached patch, roughly tested.
Comment #3
jide commentedUpdate : the code has moved to mailhandler_node_submit.
Comment #4
SamRose commentedWill this code also work with Drupal 5.x ? My tests so far seem to indicate that it will not...
Comment #5
SamRose commentedOk, tested by inserting this into line 193 in mailhanlder.module Drupal 5.x, and indeed it does work.
Comment #6
jide commentedGood to know that it also works for 5.x. Maybe you could submit a specific patch for 5.x ?
Any update on this patch anyone ?
Comment #7
SamRose commentedSure, I will submit a patch, I just need to a moment soon to take my other custom code out so that patch will match your work, will do ASAP
Comment #8
z.stolar commentedI just committed another patch, based on the one on #3 up here. Please test the last CVS version and tell me if it works fine for you.
Comment #9
z.stolar commentedPlease re-open if needed.