Comment submitted, but doesn't go anywhere ... ?

Please report bugs here!

Moderator: Thorsten

Post Reply
scrappy
Posts: 15
Joined: Sun Jan 08, 2006 6:31 am

Comment submitted, but doesn't go anywhere ... ?

Post by scrappy »

Added a few FAQ items to our new phpMyFAQ 1.5.5 system ... postgresql 8.1 backend ... everything seems to work well, except when I submit a comment to an item ... nothing seems to go anywhere ... checked "SELECT * FROM faqcomments;", and its empty ... and checked the error log for postgresql, and no errors there ...

Before I run through and try to debug this, is this a known problem that has already been fixed?

Thanks ...
Thorsten
Posts: 15725
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Post by Thorsten »

Hi,

can you enable the debug mode in inc/ini.php and post the queries here?

Thanks!

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
scrappy
Posts: 15
Joined: Sun Jan 08, 2006 6:31 am

Post by scrappy »

DEBUG INFORMATION:
SELECT thema FROM faqdata WHERE id = 6 AND lang = 'en'
SELECT keywords FROM faqdata WHERE id = 6 AND lang = 'en'
SELECT id, lang, parent_id, name, description FROM faqcategories WHERE lang = 'en' ORDER BY id
SELECT faqcategories.id AS id, faqcategories.lang AS lang, faqcategories.parent_id AS parent_id, faqcategories.name AS name, faqcategories.description AS description FROM faqcategoryrelations, faqcategories WHERE faqcategories.id=faqcategoryrelations.category_id AND faqcategoryrelations.record_id = 6 AND faqcategoryrelations.category_lang = 'en'
SELECT count(sid) FROM faqsessions WHERE time > 1136783381 GROUP BY ip
SELECT DISTINCT faqdata.id AS id, faqdata.lang AS lang, faqdata.thema AS thema, faqcategoryrelations.category_id AS category_id, faqvisits.visits AS visits FROM faqvisits, faqdata LEFT JOIN faqcategoryrelations ON faqdata.id = faqcategoryrelations.record_id AND faqdata.lang = faqcategoryrelations.record_lang WHERE faqdata.lang = 'en' AND faqdata.id = faqvisits.id AND faqdata.lang = faqvisits.lang AND faqdata.active = 'yes' ORDER BY faqvisits.visits DESC
SELECT DISTINCT faqdata.id AS id, faqdata.lang AS lang, faqcategoryrelations.category_id AS category_id, faqdata.thema AS thema, faqdata.datum AS datum, faqvisits.visits AS visits FROM faqvisits, faqdata LEFT JOIN faqcategoryrelations ON faqdata.id = faqcategoryrelations.record_id AND faqdata.lang = faqcategoryrelations.record_lang WHERE faqdata.lang = 'en' AND faqdata.id = faqvisits.id AND faqdata.lang = faqvisits.lang AND faqdata.active = 'yes' ORDER BY faqdata.datum DESC
Thorsten
Posts: 15725
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Post by Thorsten »

Hi,

are these queries the ones after a comment post?

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
scrappy
Posts: 15
Joined: Sun Jan 08, 2006 6:31 am

Post by scrappy »

Yes, cut-n-paste'd directly ...
Thorsten
Posts: 15725
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Post by Thorsten »

Hi,

okay, I'll test it the next days with a local PostgreSQL installation.

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
Thorsten
Posts: 15725
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Post by Thorsten »

Hi,

can you please replace line 38 in savecomment.php with the following line:

Code: Select all

$result = $db->query("INSERT INTO ".SQLPREFIX."faqcomments (id_comment, id, usr, email, comment, datum, helped) VALUES (".$db->nextID(SQLPREFIX."faqcomments", "id_comment").", ".$id.", '".$comment_by_user."', '".$comment_by_mail."', '".$comment."', ".$datum.", '".$helped."')");
bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
scrappy
Posts: 15
Joined: Sun Jan 08, 2006 6:31 am

Post by scrappy »

Looks like the same result ... ? how come the INSERT isn't listed in the DEBUG? even if it failed, shouldn't it be listed?

DEBUG INFORMATION:
SELECT thema FROM faqdata WHERE id = 6 AND lang = 'en'
SELECT keywords FROM faqdata WHERE id = 6 AND lang = 'en'
SELECT id, lang, parent_id, name, description FROM faqcategories WHERE lang = 'en' ORDER BY id
SELECT faqcategories.id AS id, faqcategories.lang AS lang, faqcategories.parent_id AS parent_id, faqcategories.name AS name, faqcategories.description AS description FROM faqcategoryrelations, faqcategories WHERE faqcategories.id=faqcategoryrelations.category_id AND faqcategoryrelations.record_id = 6 AND faqcategoryrelations.category_lang = 'en'
SELECT count(sid) FROM faqsessions WHERE time > 1136842629 GROUP BY ip
SELECT DISTINCT faqdata.id AS id, faqdata.lang AS lang, faqdata.thema AS thema, faqcategoryrelations.category_id AS category_id, faqvisits.visits AS visits FROM faqvisits, faqdata LEFT JOIN faqcategoryrelations ON faqdata.id = faqcategoryrelations.record_id AND faqdata.lang = faqcategoryrelations.record_lang WHERE faqdata.lang = 'en' AND faqdata.id = faqvisits.id AND faqdata.lang = faqvisits.lang AND faqdata.active = 'yes' ORDER BY faqvisits.visits DESC
SELECT DISTINCT faqdata.id AS id, faqdata.lang AS lang, faqcategoryrelations.category_id AS category_id, faqdata.thema AS thema, faqdata.datum AS datum, faqvisits.visits AS visits FROM faqvisits, faqdata LEFT JOIN faqcategoryrelations ON faqdata.id = faqcategoryrelations.record_id AND faqdata.lang = faqcategoryrelations.record_lang WHERE faqdata.lang = 'en' AND faqdata.id = faqvisits.id AND faqdata.lang = faqvisits.lang AND faqdata.active = 'yes' ORDER BY faqdata.datum DESC
Thorsten
Posts: 15725
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Post by Thorsten »

Hi,

can you try to insert the INSERT query from savecomment.php in your PostgreSQL console? Just to test this.

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
scrappy
Posts: 15
Joined: Sun Jan 08, 2006 6:31 am

Post by scrappy »

/tmp/psql.edit.50431: 1 lines, 163 characters.
ERROR: integer out of range

the faqcomments.datum value needs to be changed to a bigint instead of an int ...
Thorsten
Posts: 15725
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Post by Thorsten »

Hi,

I fixed it in the install scripts. Does a ALTER TABLE work in PostgreSQL?

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
scrappy
Posts: 15
Joined: Sun Jan 08, 2006 6:31 am

Post by scrappy »

ALTER TABLE faqcomments ALTER COLUMN datum TYPE bigint;

I'm not sure how far back in releases, though, that it works on columns ... I'm using 8.1 ...
Thorsten
Posts: 15725
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Post by Thorsten »

Hi,

great, I'll add that on the update script for 1.5.6.

Thanks for your help.

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
Post Reply