Project

General

Profile

Issues aren't updated when answering via mail

Added by Hauke Altmann over 10 years ago

Hey people,
I'm using the imap cronjob to retrieve incoming emails from an remote server. Creating new issues works like charm but updating existing issues by answering via email fails.

In the log files a SQL error is thrown because the "created_on" value of the journals table is set to nil.

INSERT INTO `journals` (`created_on`, `journalized_id`, `journalized_type`, `notes`, `private_notes`, `user_id`) 
VALUES (?, ?, ?, ?, ?, ?)  [["created_on", nil], ["journalized_id", 509], ["journalized_type", "Issue"], 
["notes", "..."], ["private_notes", false], ["user_id", 1]]

Mysql::Error: Column 'created_on' cannot be null: INSERT INTO `journals` 
(`created_on`, `journalized_id`, `journalized_type`, `notes`, `private_notes`, `user_id`) 
VALUES (?, ?, ?, ?, ?, ?)

Does anyone know how to fix this?

I already digged through the source code but because my ruby knowledge is limited yet I didn't find the place to patch this.

My setup:
Redmine 2.3.3
Rails 3.2.13
ruby 1.8.7 (2011-12-28 patchlevel 357) [x86_64-linux]
mysqld Ver 5.1.63-log for suse-linux-gnu on x86_64
thin 1.5.1
OpenSuse 11.4

I would appreciate any help,

Thanks and cheers,

Hauke


Replies (2)

RE: Issues aren't updated when answering via mail - Added by Hauke Altmann over 10 years ago

So I fixed this issue by adding this line

journal.created_on = Time.now

to the 'receive_issue_reply' method in the MailHandler class (app/models/mail_handler.rb, after line 211)

As it seems to be working for everyone else, I'm still confused why this issue existed for me. So if anyone can give me an answer for that, I would still appreciate it.

Cheers,

Hauke

    (1-2/2)