Search and Filter cannot be used at the same time

Permalink Browser Info Environment
I'm submitting as regular general discussion since my client didn't give us the access to their project.

Anyway, we're using 5.6.0.0.0.5.7.

Select Filter Search doesn't work when date/time filter is used at the same time..

Situation:

- We have a page list of an event listing
- It has select search to narrow down the event category (which is set as select attribute)
- It has event date. We wanted to set the filter "is today or after" so that the past event page won't show up.

When the date/time filter is set, the search doesn't really work.

Thanks

Type: Discussion
Status: In Progress
katz515
View Replies:
katz515 replied on at Permalink Reply
katz515
Dave

I've run the debug mode.

This is the default query.

Default query
(mysqlt): select p1.cID, pt.ctHandle from Pages p1 left join Pages p2 on (p1.cPointerID = p2.cID) left join PagePaths on (PagePaths.cID = p1.cID and PagePaths.ppIsCanonical = 1) left join PageSearchIndex psi on (psi.cID = if(p2.cID is null, p1.cID, p2.cID)) inner join CollectionVersions cv on (cv.cID = if(p2.cID is null, p1.cID, p2.cID) and cvID = (select cvID from CollectionVersions where cvIsApproved = 1 and cID = cv.cID)) left join PageTypes pt on pt.ctID = cv.ctID inner join Collections c on (c.cID = if(p2.cID is null, p1.cID, p2.cID)) left join CollectionSearchIndexAttributes on (CollectionSearchIndexAttributes.cID = if (p2.cID is null, p1.cID, p2.cID)) where 1=1 and (ak_date_end>='2015-08-11 00:00:00') and (p2.cPointerID is null) and /* filled-in version name */ cvName!='' and /* page types */ (pt.ctID IN (14,20,21)) and /* page_list exclusion */ (ak_exclude_page_list = 0 OR ak_exclude_page_list is null) and p1.cParentID = '143' and cvIsApproved = '1' and (p1.cIsTemplate = 0 or p2.cIsTemplate = 0) and p1.cIsActive = '1' order by ak_date_end asc, p1.cDisplayOrder asc limit 0,21


Then, this is when I ran the search.

With search query

(mysqlt): select p1.cID, pt.ctHandle from Pages p1 left join Pages p2 on (p1.cPointerID = p2.cID) left join PagePaths on (PagePaths.cID = p1.cID and PagePaths.ppIsCanonical = 1) left join PageSearchIndex psi on (psi.cID = if(p2.cID is null, p1.cID, p2.cID)) inner join CollectionVersions cv on (cv.cID = if(p2.cID is null, p1.cID, p2.cID) and cvID = (select cvID from CollectionVersions where cvIsApproved = 1 and cID = cv.cID)) left join PageTypes pt on pt.ctID = cv.ctID inner join Collections c on (c.cID = if(p2.cID is null, p1.cID, p2.cID)) left join CollectionSearchIndexAttributes on (CollectionSearchIndexAttributes.cID = if (p2.cID is null, p1.cID, p2.cID)) where 1=1 and (ak_date_end>='2015-08-11 00:00:00') and ((ak_campaign_product LIKE '%\n1970-01-01 09:00:00\n%')) and (p2.cPointerID is null) and /* filled-in version name */ cvName!='' and /* page types */ (pt.ctID IN (14,20,21)) and /* page_list exclusion */ (ak_exclude_page_list = 0 OR ak_exclude_page_list is null) and p1.cParentID = '143' and cvIsApproved = '1' and (p1.cIsTemplate = 0 or p2.cIsTemplate = 0) and p1.cIsActive = '1' order by ak_date_end asc, p1.cDisplayOrder asc limit 0,21


You can see that 'ak_campaign_product' is outputting DATE format where it supposed to be just a keyword.
katz515 replied on at Permalink Reply 1 Attachment
katz515
OK Fixed

For the bug fix that I've been doing I deserve for a couple licenses. :p

diff --git a/packages/skybluesofa_page_list_plus/models/page_list_plus.php b/packages/skybluesofa_page_list_plus/models/page_list_plus.php
index 74cc938..f785d30 100755
--- a/packages/skybluesofa_page_list_plus/models/page_list_plus.php
+++ b/packages/skybluesofa_page_list_plus/models/page_list_plus.php
@@ -261,6 +261,8 @@ class PageListPlus
             } else {
                $currentValue = $this->collectionObject->getCollectionAttributeValue($attributeKey);
                $handle = 'ak_' . $attributeKey->akHandle;
+
+               $isDate = false;
                if ($attributeKey->atHandle == "date_time") {
                   $isDate = true;
                   $db = Loader::db();
-- 
1.8.4.2
katz515 replied on at Permalink Reply 2 Attachments
katz515
Dave,

I got excited and it was a bit too early to post my previous patch.

I should have put $isDate = false a bit earlier to cover the standard property.

I think you should also do one for 5.7

I've attached two files for PL+

concrete5 Environment Information

All

Browser User-Agent String

Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/44.0.2403.130 Safari/537.36

Hide Post Content

This will replace the post content with the message: "Content has been removed by an Administrator"

Hide Content

Request Refund

You may not request a refund that is not currently owned by you.