Category Content Missing

All about webserver configurations, PHP and databases.

Moderator: Thorsten

ajhven
Posts: 10
Joined: Wed Apr 02, 2014 8:55 pm

Category Content Missing

Post by ajhven » Wed Apr 02, 2014 9:04 pm

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!
Aaron

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

Re: Category Content Missing

Post by Thorsten » Thu Apr 03, 2014 7:50 pm

Hi,

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

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist

ajhven
Posts: 10
Joined: Wed Apr 02, 2014 8:55 pm

Re: Category Content Missing

Post by ajhven » Mon Apr 07, 2014 4:03 pm

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.
Aaron

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

Re: Category Content Missing

Post by Thorsten » Mon Apr 07, 2014 7:11 pm

Hi,

is it possible to get access to your FAQ?

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist

ajhven
Posts: 10
Joined: Wed Apr 02, 2014 8:55 pm

Re: Category Content Missing

Post by ajhven » Mon Apr 07, 2014 7:28 pm

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?
Aaron

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

Re: Category Content Missing

Post by Thorsten » Mon Apr 07, 2014 7:33 pm

Hi,

so you don't get any errors if you enable the debug mode. Do you see the category content in the admin section?
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist

ajhven
Posts: 10
Joined: Wed Apr 02, 2014 8:55 pm

Re: Category Content Missing

Post by ajhven » Tue Apr 08, 2014 4:19 pm

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.
Aaron

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

Re: Category Content Missing

Post by Thorsten » Tue Apr 08, 2014 4:59 pm

Hi,

I think I have to rebuild your infrastructure.

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist

ajhven
Posts: 10
Joined: Wed Apr 02, 2014 8:55 pm

Re: Category Content Missing

Post by ajhven » Thu Apr 10, 2014 3:46 pm

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"
Aaron

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

Re: Category Content Missing

Post by Thorsten » Thu Apr 10, 2014 4:04 pm

Hi,

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

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist

ajhven
Posts: 10
Joined: Wed Apr 02, 2014 8:55 pm

Re: Category Content Missing

Post by ajhven » Thu Apr 10, 2014 4:42 pm

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.
Aaron

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

Re: Category Content Missing

Post by Thorsten » Thu Apr 10, 2014 4:52 pm

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
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist

ajhven
Posts: 10
Joined: Wed Apr 02, 2014 8:55 pm

Re: Category Content Missing

Post by ajhven » Thu Apr 10, 2014 5:06 pm

The error was for the Group By clause
Aaron

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

Re: Category Content Missing

Post by Thorsten » Thu Apr 10, 2014 5:10 pm

Hi,

does it work if you remove the

Code: Select all

fd.sticky DESC, 
part?

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist

ajhven
Posts: 10
Joined: Wed Apr 02, 2014 8:55 pm

Re: Category Content Missing

Post by ajhven » Thu Apr 10, 2014 5:17 pm

No change
Aaron

Post Reply