PHP 4.3.3
Postgresql 7.3.4
Drupal 4.3.2
(using debian packages)
Where: Comment Viewing Options
What did I do: Clicked the "Save Settings" button.
Result: The following error....
warning: pg_exec(): Query failed: ERROR: pg_atoi: zero-length string
. in /usr/share/php/DB/pgsql.php on line 164.
user error: DB Error: unknown error
query: UPDATE users SET mode = '4', sort = '1', threshold = '', data = 'a:4:{s:5:\"block\";a:0:{}s:5:\"pass1\";s:0:\"\";s:5:\"pass2\";s:0:\"\";s:17:\"comments_per_page\";s:2:\"50\";}', timestamp = 1081938567 WHERE uid = 1 in /usr/share/drupal/includes/database.pear.inc on line 89.
warning: Cannot modify header information - headers already sent by (output started at /usr/share/drupal/includes/common.inc:63) in /usr/share/drupal/includes/common.inc on line 472.
Cheers,
Cliff
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | comment.module.4.3.2.diff | 418 bytes | cliffp |
| #4 | comment_setting_error.diff | 959 bytes | adrian |
Comments
Comment #1
cliffp commentedI've just assigned a threshold of "everything", value 0. That gets around the problem. So, if it's a bug, as I believe it is, there's a workaround. .
I guess the code should assign a default value of "0" if there aren't any thresholds defined... but this **is** a back release...
Cheers,
Cliff
Comment #2
adrian commentedI think the correct procedure in this case would be to have the sql generated correctly.
This likely only works on mysql because the field restrictions aren't strict enough.
Comment #3
(not verified) commentedI am on Drupal 4.4.0 (and PostgreSQL) and have this problem too.
Comment #4
adrian commentedI found out the problem was across all db's, postgres just had stricter validation on the threshold field (ie: not null)
The
theme_comment_thresholdwas not returning a hidden field when moderation wasn't enabled, hence the form didn't recieve what it thought it did.This is a 3 line patch to fix this for release
it applies cleanly to head.
Comment #5
dries commentedCommitted to both the HEAD and the DRUPAL-4-4 branch. Thanks Adrian.
Comment #6
cliffp commentedCool! Thanks Adrian. I'm presuming the patch is for 4.4.x? Will it fit on 4.3.2, do you know, off the top of your head? If not, I'll try to retrofit it for my own purposes.
Cheers,
Cliff
Comment #7
cliffp commentedHere's a diff of my patched module against the original comments module. I don't know what the protocol for supplying patches, but this works on my Debian system with Drupal 4.3.2-2, for anyone that is interested.
Cheers,
Cliff
Comment #8
(not verified) commented