Popfetcher entries not successfully inserted

Creating and modifying plugins.
Post Reply
paver
Regular
Posts: 5
Joined: Wed Oct 04, 2006 9:55 pm

Popfetcher entries not successfully inserted

Post 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.
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Popfetcher entries not successfully inserted

Post 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
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
paver
Regular
Posts: 5
Joined: Wed Oct 04, 2006 9:55 pm

Post 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.
paver
Regular
Posts: 5
Joined: Wed Oct 04, 2006 9:55 pm

Post 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.
paver
Regular
Posts: 5
Joined: Wed Oct 04, 2006 9:55 pm

Post 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.
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post 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
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
paver
Regular
Posts: 5
Joined: Wed Oct 04, 2006 9:55 pm

Post 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!
Post Reply