Error Deleting FAQ, PMF 2.6.5

Please report bugs here!

Moderator: Thorsten

Post Reply
dajoker
Posts: 59
Joined: Sat Jan 30, 2010 1:01 am

Error Deleting FAQ, PMF 2.6.5

Post by dajoker »

I do not think this is related to any changes I've made but I could be wrong. The SQL doing this doesn't sound familiar so I think it must just be part of the system.

When deleting a FAQ the following SQL is used and the included errors as well:

<quote>
2010-06-14 16:24:24.553 MDT phpmyfaqdb phpmyfaqadmin LOG: statement: DELETE FROM faqchanges WHERE beitrag = 10101192 AND lang = 'en'
2010-06-14 16:24:24.561 MDT phpmyfaqdb phpmyfaqadmin LOG: statement: DELETE FROM faqcategoryrelations WHERE record_id = 10101192 AND record_lang = 'en'
2010-06-14 16:24:24.569 MDT phpmyfaqdb phpmyfaqadmin LOG: statement: DELETE FROM faqdata WHERE id = 10101192 AND lang = 'en'
2010-06-14 16:24:24.578 MDT phpmyfaqdb phpmyfaqadmin LOG: statement: DELETE FROM faqdata_revisions WHERE id = 10101192 AND lang = 'en'
2010-06-14 16:24:24.578 MDT phpmyfaqdb phpmyfaqadmin LOG: statement: DELETE FROM faqvisits WHERE id = 10101192 AND lang = 'en'
2010-06-14 16:24:24.586 MDT phpmyfaqdb phpmyfaqadmin LOG: statement: DELETE FROM faqdata_user WHERE record_id = 10101192 AND record_lang = 'en'
2010-06-14 16:24:24.586 MDT phpmyfaqdb phpmyfaqadmin ERROR: column "record_lang" does not exist at character 57
2010-06-14 16:24:24.586 MDT phpmyfaqdb phpmyfaqadmin STATEMENT: DELETE FROM faqdata_user WHERE record_id = 10101192 AND record_lang = 'en'
2010-06-14 16:24:24.586 MDT phpmyfaqdb phpmyfaqadmin LOG: statement: DELETE FROM faqdata_group WHERE record_id = 10101192 AND record_lang = 'en'
2010-06-14 16:24:24.587 MDT phpmyfaqdb phpmyfaqadmin ERROR: column "record_lang" does not exist at character 58
2010-06-14 16:24:24.587 MDT phpmyfaqdb phpmyfaqadmin STATEMENT: DELETE FROM faqdata_group WHERE record_id = 10101192 AND record_lang = 'en'
2010-06-14 16:24:24.587 MDT phpmyfaqdb phpmyfaqadmin LOG: statement: DELETE FROM faqdata_tags WHERE record_id = 10101192
2010-06-14 16:24:24.587 MDT phpmyfaqdb phpmyfaqadmin LOG: statement: DELETE FROM faqdata_tags WHERE faqdata_tags.record_id NOT IN (SELECT faqdata.id FROM faqdata)
2010-06-14 16:24:24.588 MDT phpmyfaqdb phpmyfaqadmin LOG: statement: DELETE FROM faqcomments WHERE id = 10101192
2010-06-14 16:24:24.588 MDT phpmyfaqdb phpmyfaqadmin LOG: statement: DELETE FROM faqvoting WHERE artikel = 10101192
</quote>

Steps to Duplicate: Go to find FAQs and notice the shredder icon (Delete). Be sure you have rights to delete. Delete and the error should show up. The FAQ is deleted even though the error appears.

It looks to me like the faqdata_group and faqdata_user tables should include a record_lang section so that permissions COULD be applied per language. That may be unnecessary and this an artifact of something that was undone at some point in time but there you go.

Thanks.
dajoker
Posts: 59
Joined: Sat Jan 30, 2010 1:01 am

Re: Error Deleting FAQ, PMF 2.6.5

Post by dajoker »

I should mention that the web-based interface (vs. the PostgreSQL logging) has the following error(s) and messages:

<quote>
phpMyFAQ warning [2]: pg_query(): Query failed: ERROR: column "record_lang" does not exist LINE 1: ... FROM faqdata_user WHERE record_id = 10101192 AND record_lan... ^ in Pgsql.php on line 91

phpMyFAQ warning [2]: pg_query(): Query failed: ERROR: column "record_lang" does not exist LINE 1: ...FROM faqdata_group WHERE record_id = 10101192 AND record_lan... ^ in Pgsql.php on line 91
Issue successfully deleted.
</quote>

Notice that the issue is successfully deleted.

If, on the other hand, the user does not have rights to delete a FAQ then the FAQ disappears from the list until the search is executed again but there is no error (the delete is not really attempted).
Thorsten
Posts: 15561
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: Error Deleting FAQ, PMF 2.6.5

Post by Thorsten »

Hi,

thanks for the hint, there's an error in 2 SQL queries. Here's the fix: http://github.com/thorsten/phpMyFAQ/com ... df1f990404

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