Page 1 of 1

Popfetcher entries not successfully inserted

Posted: Wed Oct 04, 2006 10:00 pm
by paver
Hello,

I'm using Serendipity 1.0.1 with postgresql and popfetcher 1.14. I've got the mailbox setup and serendipity can log in to it, but when it extracts an email, it fails to insert it. Here's the output I get when I run the plugin manually from the admin console:
POPfetcher v1.14 @ Wed Oct 4 15:56:42 EDT 2006

Number of messages extracted from your mailbox: 1
All messages are still in your mailbox
Date: Wed, 4 Oct 2006 15:35:18 -0400
From: ben
Subject: test again

Published new blog entry with id: Entries were not successfully inserted!
Has anyone had this problem or does anyone have any suggestions on what I should do to fix this?

Thanks in advance.

Re: Popfetcher entries not successfully inserted

Posted: Thu Oct 05, 2006 12:29 pm
by garvinhicking
Hi!

Do you maybe have access to your postgreSQL error/output log? Maybe the SQL query that failed is listed there?

Regards,
Garvin

Posted: Thu Oct 05, 2006 5:16 pm
by paver
Hi,

I turned on statement logging. Here's the relevant entries:

LOG: statement: INSERT INTO serendipity_entries (isdraft,title,body,authorid,allow_comments,moderate_comments,extended,timestamp,exflag,comments,last_modified,author) values ('false', 'test again', 'This is a test.', '1', '1', '', '', '1160061316', '0', '0', '1160061316', 'ben')
ERROR: invalid input syntax for type boolean: ""

Thanks.

Posted: Thu Oct 05, 2006 5:45 pm
by paver
The problem seems to be with the moderate_comments field. The sql is trying to set that field to be blank, but it needs to be true or false. If I set the moderate_comments to be true, it works, but when set to false, it fails.

Posted: Thu Oct 05, 2006 6:06 pm
by paver
I got it working by adding this line:

$entry['moderate_comments'] = 'false';

after this line:

$entry['moderate_comments'] = serendipity_db_bool($this->get_config('default_moderate', false));

Obviously, this is a hack to work around something else that isn't working correctly.

Posted: Fri Oct 06, 2006 11:15 am
by garvinhicking
Hi!

Usually the option should be set due to what the 'Default_moderate' option is set to. How did you configure the popfetcher plugin for the moderation option?

Best regards,
Garvin

Posted: Fri Oct 06, 2006 4:07 pm
by paver
I set it to false so that it would not require moderation. But, for some reason, that option doesn't make it through to the $entries['moderate_comments'] array item. It doesn't make sense because the code is identical for the allow_comments option, which does work.

Thanks!