Page 1 of 2

Category Content Missing

Posted: Wed Apr 02, 2014 9:04 pm
by ajhven
Hi Folks,

I'm new to PHPMyFAQ and this forum. I tried searching but couldn't find a solution (possibly just don't know the right keywords yet).

When I click on a category, it tells me how may FAQs there are, but doesn't actually display links to them. The 2 FAQs I've created show up in search and in the Sticky area, but they don't show up as links under the category. The best I can tell is that this is the categoryContent section in the show.tpl template file.

I turned on debug in the /inc/bootstrap.php file, but I saw no debug output - even after restarting the website and recycling the app pool - no difference whether logged in or not.

I'm running MyPHPFAQ 2.8.8 on IIS 8.5, PHP 5.3 and Microsoft SQL Express 2012.

Any help or direction to an existing FAQ would be great.

Thanks!

Re: Category Content Missing

Posted: Thu Apr 03, 2014 7:50 pm
by Thorsten
Hi,

this fix should help: https://github.com/thorsten/phpMyFAQ/co ... dd8d0f4fcb

bye
Thorsten

Re: Category Content Missing

Posted: Mon Apr 07, 2014 4:03 pm
by ajhven
Thanks for the response Thorsten. Unfortunately it's still not showing the individual KBs. Tried IE and Chrome after making change, recycling app pool and restarting website.

Re: Category Content Missing

Posted: Mon Apr 07, 2014 7:11 pm
by Thorsten
Hi,

is it possible to get access to your FAQ?

bye
Thorsten

Re: Category Content Missing

Posted: Mon Apr 07, 2014 7:28 pm
by ajhven
For security reasons it is not publicly accessible. I know that makes it harder to troubleshoot, but can't be avoided unfortunately. Is there something I can run as a test?

Re: Category Content Missing

Posted: Mon Apr 07, 2014 7:33 pm
by Thorsten
Hi,

so you don't get any errors if you enable the debug mode. Do you see the category content in the admin section?

Re: Category Content Missing

Posted: Tue Apr 08, 2014 4:19 pm
by ajhven
Without logging in I see no category content in the main panel, but the FAQs populate properly in the Sticky, Latest, and Most popular FAQs panels. Same when I log in.

If I log in and go to Administration -> Edit existing FAQs, I see the categories listed with the correct number of FAQs, and the FAQs show up when I click on a category.

Re: Category Content Missing

Posted: Tue Apr 08, 2014 4:59 pm
by Thorsten
Hi,

I think I have to rebuild your infrastructure.

bye
Thorsten

Re: Category Content Missing

Posted: Thu Apr 10, 2014 3:46 pm
by ajhven
PHP log shows - "[10-Apr-2014 16:45:25 Europe/Berlin] phpMyFAQ warning: sqlsrv_num_rows() expects parameter 1 to be resource, boolean given in C:\phpmyfaq\inc\PMF\DB\Sqlsrv.php on line 206"

Re: Category Content Missing

Posted: Thu Apr 10, 2014 4:04 pm
by Thorsten
Hi,

ah, that's the reason! I'll check the code!

bye
Thorsten

Re: Category Content Missing

Posted: Thu Apr 10, 2014 4:42 pm
by ajhven
I output the query as faq.php is generating it:
SELECT
fd.id AS id,
fd.lang AS lang,
fd.sticky AS sticky,
fd.thema AS thema,
fcr.category_id AS category_id,
fv.visits AS visits
FROM
slcfaqdata AS fd
LEFT JOIN
slcfaqcategoryrelations AS fcr
ON
fd.id = fcr.record_id
AND
fd.lang = fcr.record_lang
LEFT JOIN
slcfaqvisits AS fv
ON
fd.id = fv.id
AND
fv.lang = fd.lang
LEFT JOIN
slcfaqdata_group AS fdg
ON
fd.id = fdg.record_id
LEFT JOIN
slcfaqdata_user AS fdu
ON
fd.id = fdu.record_id
WHERE
fd.date_start <= '20140410172626'
AND
fd.date_end >= '20140410172626'
AND
fd.active = 'yes'
AND
fcr.category_id = 3
AND
fd.lang = 'en'
AND ( fdg.group_id IN (-1, 1) OR (fdu.user_id IN (-1, 2) OR fdg.group_id IN (-1, 1)) )
GROUP BY fd.id, fd.lang, fcr.category_id, fv.visits
ORDER BY fd.sticky DESC, fd.id DESC
And this is the error I get when I run it directly in SQL Server 2012 Mangement Studio:
Msg 8120, Level 16, State 1, Line 5
Column 'slcfaqdata.sticky' is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause.
If I add fd.sticky to the GROUP BY clause, then it complains about the slcfaqdata.thema being invalid. If I add that, then I get:
Msg 306, Level 16, State 2, Line 41
The text, ntext, and image data types cannot be compared or sorted, except when using IS NULL or LIKE operator.
Not sure where to go from here.

Re: Category Content Missing

Posted: Thu Apr 10, 2014 4:52 pm
by Thorsten
Hi,

looks like MS SQL Server has problems with this query, I think I can remove the ORDER BY part and do that in PHP.

bye
Thorsten

Re: Category Content Missing

Posted: Thu Apr 10, 2014 5:06 pm
by ajhven
The error was for the Group By clause

Re: Category Content Missing

Posted: Thu Apr 10, 2014 5:10 pm
by Thorsten
Hi,

does it work if you remove the

Code: Select all

fd.sticky DESC, 
part?

bye
Thorsten

Re: Category Content Missing

Posted: Thu Apr 10, 2014 5:17 pm
by ajhven
No change