FAQs not showing
Moderator: Thorsten
FAQs not showing
I migrated my FAQ from a server running on MS SQL Server to a server running MySQL 5.5.8. I used the FAQ export from the admin page. Everything seemed to go alright. Some of my FAQs had newlines in the text, but I just had to manually import those using phpMyAdmin, so that wasn't a very big deal. The problem is that now I'm not seeing any FAQ in my home page. If I open a category, it doesn't show any FAQs either. If I run a search, I don't see any FAQs. Then, if I log in to the Admin page I see all of the FAQs and I see that they're all active and that they do in fact exist. In fact, I can run the search in the Admin page and it even returns results. So, I'm not sure what's different from the Admin search and the normal FAQ page search. Is there any way that I can debug this or is there a specific file that I can look through to try to debug this situation? I develop in PHP, so I feel comfortable looking through the code.
Re: FAQs not showing
Hi,
do you have entries in the table faqcategoryrelations, faqdata_user and faqdata_group?
bye
Thorsten
do you have entries in the table faqcategoryrelations, faqdata_user and faqdata_group?
bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
amazon.de Wishlist
Re: FAQs not showing
faqcategoryrelations has 914 records which sounds good
faqdata_user has the 3 users that I created in the original db
faqdata_group is completely empty, but I don't know if I even had any groups in the original db... Will that matter?
faqdata_user has the 3 users that I created in the original db
faqdata_group is completely empty, but I don't know if I even had any groups in the original db... Will that matter?
Re: FAQs not showing
Hi,
should work without the groups. Is it possible to get your DB dump?
bye
Thorsten
should work without the groups. Is it possible to get your DB dump?
bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
amazon.de Wishlist
Re: FAQs not showing
Unfortunately, I can't do a db export because the company that I work at uses phpMyFAQ for data that we keep internally. I double checked the db export and confirmed that there was nothing that needed to be imported into faqdata_group, so I don't think any data is missing from the migration.
Are there any other tables I can check or any other way that I can debug the code to see what's going wrong?
Are there any other tables I can check or any other way that I can debug the code to see what's going wrong?
Re: FAQs not showing
Hi,
you can enable the debug log in inc/Init.php
bye
Thorsten
you can enable the debug log in inc/Init.php
bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
amazon.de Wishlist
Re: FAQs not showing
Here is my debug information when I run a search for the word "linux". The last line is querying faqdata, but it doesn't contain the search text and I confirmed that the query returns no rows:
DEBUG INFORMATION:
C:\phpmyfaq\inc\Init.php:
PMF_Configuration->getAll() in line 106: SELECT config_name, config_value FROM faqconfig
C:\phpmyfaq\inc\PMF_User\CurrentUser.php:
PMF_User->getUserById() in line 416: SELECT user_id, login, account_status FROM faquser WHERE user_id = 1
C:\phpmyfaq\inc\PMF_User\CurrentUser.php:
PMF_User->getUserById() in line 416: SELECT pass FROM faquserlogin WHERE login = 'admin'
C:\phpmyfaq\inc\User.php:
PMF_User_UserData->load() in line 319: SELECT last_modified, display_name, email FROM faquserdata WHERE user_id = 1
C:\phpmyfaq\inc\PMF_User\CurrentUser.php:
PMF_User_CurrentUser->getSessionInfo() in line 423: SELECT session_id, session_timestamp, ip FROM faquser WHERE user_id = 1
C:\phpmyfaq\index.php:
PMF_Perm_PermBasic->getAllRightsData() in line 148: SELECT right_id, name, description, for_users, for_groups FROM faqright ORDER BY right_id ASC
C:\phpmyfaq\inc\PMF_Perm\PermBasic.php:
PMF_Perm_PermBasic->getUserRights() in line 268: SELECT fr.right_id AS right_id FROM faqright fr, faquser_right fur, faquser fu WHERE fr.right_id = fur.right_id AND fu.user_id = 1 AND fu.user_id = fur.user_id
C:\phpmyfaq\index.php:
PMF_Session->checkSessionId() in line 223: SELECT sid FROM faqsessions WHERE sid = 1828 AND ip = 'REMOVED' AND time > 1333907005
C:\phpmyfaq\index.php:
PMF_Session->checkSessionId() in line 223: UPDATE faqsessions SET time = 1333993405, user_id = 1 WHERE sid = 1828 AND ip = 'REMOVED'
C:\phpmyfaq\inc\Category.php:
PMF_Category->getOrderedCategories() in line 160: SELECT fc.id AS id, fc.lang AS lang, fc.parent_id AS parent_id, fc.name AS name, fc.description AS description, fc.user_id AS user_id FROM faqcategories fc LEFT JOIN faqcategory_group fg ON fc.id = fg.category_id LEFT JOIN faqcategory_user fu ON fc.id = fu.category_id WHERE ( fg.group_id IN (-1) OR (fu.user_id = 1 AND fg.group_id IN (-1))) AND fc.lang = 'en' GROUP BY fc.id, fc.lang, fc.parent_id, fc.name, fc.description, fc.user_id ORDER BY fc.id
C:\phpmyfaq\index.php:
PMF_Tags->existTagRelations() in line 390: SELECT COUNT(record_id) AS n FROM faqdata_tags
C:\phpmyfaq\index.php:
PMF_Session->getUsersOnline() in line 424: SELECT count(sid) AS anonymous_users FROM faqsessions WHERE user_id = -1 AND time > 1333993105
C:\phpmyfaq\index.php:
PMF_Session->getUsersOnline() in line 424: SELECT count(session_id) AS registered_users FROM faquser WHERE session_timestamp > 1333993105
C:\phpmyfaq\inc\Faq.php:
PMF_Faq->getStickyRecordsData() in line 2980: SELECT fd.id AS id, fd.lang AS lang, fd.thema AS thema, fcr.category_id AS category_id FROM faqdata fd LEFT JOIN faqcategoryrelations fcr ON fd.id = fcr.record_id AND fd.lang = fcr.record_lang LEFT JOIN faqdata_group AS fdg ON fd.id = fdg.record_id LEFT JOIN faqdata_user AS fdu ON fd.id = fdu.record_id WHERE fd.lang = 'en' AND fd.date_start <= '20120409194326' AND fd.date_end >= '20120409194326' AND fd.active = 'yes' AND fd.sticky = 1 AND ( fdu.user_id = 1 OR fdu.user_id = -1 )
DEBUG INFORMATION:
C:\phpmyfaq\inc\Init.php:
PMF_Configuration->getAll() in line 106: SELECT config_name, config_value FROM faqconfig
C:\phpmyfaq\inc\PMF_User\CurrentUser.php:
PMF_User->getUserById() in line 416: SELECT user_id, login, account_status FROM faquser WHERE user_id = 1
C:\phpmyfaq\inc\PMF_User\CurrentUser.php:
PMF_User->getUserById() in line 416: SELECT pass FROM faquserlogin WHERE login = 'admin'
C:\phpmyfaq\inc\User.php:
PMF_User_UserData->load() in line 319: SELECT last_modified, display_name, email FROM faquserdata WHERE user_id = 1
C:\phpmyfaq\inc\PMF_User\CurrentUser.php:
PMF_User_CurrentUser->getSessionInfo() in line 423: SELECT session_id, session_timestamp, ip FROM faquser WHERE user_id = 1
C:\phpmyfaq\index.php:
PMF_Perm_PermBasic->getAllRightsData() in line 148: SELECT right_id, name, description, for_users, for_groups FROM faqright ORDER BY right_id ASC
C:\phpmyfaq\inc\PMF_Perm\PermBasic.php:
PMF_Perm_PermBasic->getUserRights() in line 268: SELECT fr.right_id AS right_id FROM faqright fr, faquser_right fur, faquser fu WHERE fr.right_id = fur.right_id AND fu.user_id = 1 AND fu.user_id = fur.user_id
C:\phpmyfaq\index.php:
PMF_Session->checkSessionId() in line 223: SELECT sid FROM faqsessions WHERE sid = 1828 AND ip = 'REMOVED' AND time > 1333907005
C:\phpmyfaq\index.php:
PMF_Session->checkSessionId() in line 223: UPDATE faqsessions SET time = 1333993405, user_id = 1 WHERE sid = 1828 AND ip = 'REMOVED'
C:\phpmyfaq\inc\Category.php:
PMF_Category->getOrderedCategories() in line 160: SELECT fc.id AS id, fc.lang AS lang, fc.parent_id AS parent_id, fc.name AS name, fc.description AS description, fc.user_id AS user_id FROM faqcategories fc LEFT JOIN faqcategory_group fg ON fc.id = fg.category_id LEFT JOIN faqcategory_user fu ON fc.id = fu.category_id WHERE ( fg.group_id IN (-1) OR (fu.user_id = 1 AND fg.group_id IN (-1))) AND fc.lang = 'en' GROUP BY fc.id, fc.lang, fc.parent_id, fc.name, fc.description, fc.user_id ORDER BY fc.id
C:\phpmyfaq\index.php:
PMF_Tags->existTagRelations() in line 390: SELECT COUNT(record_id) AS n FROM faqdata_tags
C:\phpmyfaq\index.php:
PMF_Session->getUsersOnline() in line 424: SELECT count(sid) AS anonymous_users FROM faqsessions WHERE user_id = -1 AND time > 1333993105
C:\phpmyfaq\index.php:
PMF_Session->getUsersOnline() in line 424: SELECT count(session_id) AS registered_users FROM faquser WHERE session_timestamp > 1333993105
C:\phpmyfaq\inc\Faq.php:
PMF_Faq->getStickyRecordsData() in line 2980: SELECT fd.id AS id, fd.lang AS lang, fd.thema AS thema, fcr.category_id AS category_id FROM faqdata fd LEFT JOIN faqcategoryrelations fcr ON fd.id = fcr.record_id AND fd.lang = fcr.record_lang LEFT JOIN faqdata_group AS fdg ON fd.id = fdg.record_id LEFT JOIN faqdata_user AS fdu ON fd.id = fdu.record_id WHERE fd.lang = 'en' AND fd.date_start <= '20120409194326' AND fd.date_end >= '20120409194326' AND fd.active = 'yes' AND fd.sticky = 1 AND ( fdu.user_id = 1 OR fdu.user_id = -1 )
Re: FAQs not showing
Hi,
do youo have any data in faqdata_group? Looks like it's missing.
bye
Thorsten
do youo have any data in faqdata_group? Looks like it's missing.
bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
amazon.de Wishlist
Re: FAQs not showing
The faqdata_group table exists, but there is no data in it.
Re: FAQs not showing
Hi,
the faqdata_group table needs an entry for every FAQ ID with a group ID -1
bye
Thorsten
the faqdata_group table needs an entry for every FAQ ID with a group ID -1
bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
amazon.de Wishlist
Re: FAQs not showing
I fixed it.
I had to add rows to 2 tables.
I had to add a row to the faqdata_group table for each faqdata ID, along with a dummy -1 group ID.
Then, I had to add a row to the faqdata_user table for each faqdata ID and a dummy -1 user ID.
I had to add rows to 2 tables.
I had to add a row to the faqdata_group table for each faqdata ID, along with a dummy -1 group ID.
Then, I had to add a row to the faqdata_user table for each faqdata ID and a dummy -1 user ID.
Re: FAQs not showing
Hi,
is it working now?
bye
Thorsten
is it working now?
bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
amazon.de Wishlist