Page List block returning pages with no topic attribute when All topics selected

Permalink
Hi, folks.

I'm running a knowledge base using 5.7.5.13 and trying to create a topic overview page for my users. I'm using a Topic List block to search a particular topic tree and a Page List block using the Related Topic filtering on the same topic tree. I've got the Enable Other Blocks to Filter This Page List checkbox checked.

Now, I may be misunderstanding how topics work, but the results don't seem to be correct, at least when the All option is selected in the page. I'll try to explain. I've got thousands of pages on my site, but only a handful (around 20) are included in this topic tree. When I select one of the branch topics from the topic tree, the correct pages are displayed. However, when I select All from the topic tree, I expect all pages in that tree to display. But I am seeing a thousand results that include pages that do not have this topic attribute. It's as if the "All" selection ignores checking to see if the result pages are even part of that topic tree.

I saw someone else post something similar athttps://www.concrete5.org/community/forums/5-7-discussion/page-list-... but it seems that it's not an identical situation, and there was really no satisfactory solution there. Does this sound familiar to anyone?

campbell
 
MrKDilkington replied on at Permalink Reply
MrKDilkington
Hi campbell,

Which "All" option are you referring to?
campbell replied on at Permalink Reply 1 Attachment
campbell
I'm talking about the All option in the Flat Filter custom template in a Topic List block. I've attached an image that I grabbed from a demo site I just set up on the concrete5 site. It illustrates what I'm talking about.

I assumed that if I add a Topic List block to a page and tell it to display pages that are part of that topic list, and then I add a Page List block that lists pages only related to that topic tree, allowing the Topic List block to control it, I'm not going to get any results that fall outside that topic tree. But that doesn't seem to be the case, even on the demo site.
MrKDilkington replied on at Permalink Reply
MrKDilkington
@campbell

Without looking into the code, I am not positive about what "Related Topic" does.

Based on what you are looking to do, I think you want "Custom Topic" with the topic tree and category selected. The Page List block will only display pages with that topic attribute set.
campbell replied on at Permalink Reply
campbell
Hello again.

I tried that solution on the demo site, and it seemed to work. However, I tried it on my site (running 5.7.5.13), and received the following error:

An exception occurred while executing 'SELECT p.cID FROM Pages p LEFT JOIN PagePaths pp ON (p.cID = pp.cID and pp.ppIsCanonical = true) LEFT JOIN PageSearchIndex psi ON p.cID = psi.cID LEFT JOIN PageTypes pt ON p.ptID = pt.ptID INNER JOIN Collections c ON p.cID = c.cID INNER JOIN CollectionVersions cv ON p.cID = cv.cID LEFT JOIN CollectionSearchIndexAttributes csi ON c.cID = csi.cID INNER JOIN CollectionAttributeValues cavTopics ON cv.cID = cavTopics.cID and cv.cvID = cavTopics.cvID INNER JOIN CollectionAttributeValues cavTopics ON cv.cID = cavTopics.cID and cv.cvID = cavTopics.cvID INNER JOIN atSelectedTopics atst ON cavTopics.avID = atst.avID INNER JOIN atSelectedTopics atst ON cavTopics.avID = atst.avID INNER JOIN atSelectedTopics atst ON cavTopics.avID = atst.avID INNER JOIN atSelectedTopics atst ON cavTopics.avID = atst.avID WHERE (cvName != ?) AND (atst.TopicNodeID = ?) AND ((ak_exclude_page_list = 0 or ak_exclude_page_list is null)) AND (atst.TopicNodeID = ?) AND (p.cPointerID < 1) AND (p.cIsTemplate = 0) AND (cvIsApproved = 1) AND (p.cIsActive = ?) AND (p.cIsSystemPage = ?) ORDER BY p.cDisplayOrder asc LIMIT 1000' with params ["", 108, 108, true, false]: SQLSTATE[42000]: Syntax error or access violation: 1066 Not unique table/alias: 'cavTopics'
MrKDilkington replied on at Permalink Reply
MrKDilkington
@campbell

I am not sure how to resolve that error.
campbell replied on at Permalink Reply
campbell
Ah well. I appreciate the time you've taken so far in helping me out.

I've got a workaround in place, so this isn't a showstopper. Hopefully someone in the community will stumble across an answer in the future and comment.

Thanks! :)