digitex Posted May 31, 2014 Share Posted May 31, 2014 I just uploaded the pages for the new search I've been working on that includes a date search, location & capacity search and now when I search for location or capacity I get results but when I search for date range I get no results. BUT If I log in I do get results for date range. While working on the test I had set access permissions for the test template to superuser only but there is nothing in the code for the search that would restrict results to only show when logged in and the search template is different from the testsearch. What could cause there to be no results displayed when not logged in? EDIT: The dates are stored in a repeater. The repeater template has no access restrictions. EDIT 2: I changed the output formatting on the dates to match the format of the input from the search form and still no luck. I upgraded to pw 2.4 before starting the overhaul of the search. The old code continued to work though and the tests worked as long as I was logged in. Link to comment Share on other sites More sharing options...
Craig Posted May 31, 2014 Share Posted May 31, 2014 Does the search or search results template have any caching enabled on it? 1 Link to comment Share on other sites More sharing options...
digitex Posted May 31, 2014 Author Share Posted May 31, 2014 Does the search or search results template have any caching enabled on it? No Craig. I deleted the search page and template and recreated them both from scratch using a different name (find) and still only shows results when logged in. I checked the db and repaired, it found nothing wrong and no change. This behaviour is not browser based either. I used a different computer and got no results when not logged in. It's live and I can't revert to the old version. Link to comment Share on other sites More sharing options...
cstevensjr Posted May 31, 2014 Share Posted May 31, 2014 While working on the test I had set access permissions for the test template to superuser only but there is nothing in the code for the search that would restrict results to only show when logged in and the search template is different from the testsearch. I believe that once you set the access to the template, it will affect what is searched (i.e search results). 1 Link to comment Share on other sites More sharing options...
digitex Posted May 31, 2014 Author Share Posted May 31, 2014 I believe that once you set the access to the template, it will affect what is searched (i.e search results). I was afraid fo that. I did remove the access settings and deleted the entire template and created a new one and still no luck. However, I was able to revert to the old search and it works again, as it did without the updates. I started thinking it has to do with a mismatch in datetime format but that doesn't explain why it would work when logged in though. Link to comment Share on other sites More sharing options...
teppo Posted May 31, 2014 Share Posted May 31, 2014 Somehow this sounds like a repeater issue, though I can't quite wrap my head around it -- probably too tired at the moment. I'd still start by making sure that those repeaters really are fine, perhaps re-creating the repeater field itself, and/or making sure that the actual repeater pages under admin (/processwire/repeaters/repeater-field-name/page-name/repeater-item/) are published etc. Wouldn't be the first time that something goes wrong there. 1 Link to comment Share on other sites More sharing options...
digitex Posted May 31, 2014 Author Share Posted May 31, 2014 (edited) Somehow this sounds like a repeater issue, though I can't quite wrap my head around it -- probably too tired at the moment. I'd still start by making sure that those repeaters really are fine, perhaps re-creating the repeater field itself, and/or making sure that the actual repeater pages under admin (/processwire/repeaters/repeater-field-name/page-name/repeater-item/) are published etc. Wouldn't be the first time that something goes wrong there. I checked the repeater field. It looks right to me, published with access inherited from admin. I can't re-create the field itself, not wihtout re-populating more pages than I care to count, but the data does display on pages when not logged in, it just won't search unless logged in. I guess i could create e new repeater for testing and see if that will search. EDIT: I created a new test repeater and populated enough fields to test and got the same results. Logged in it returned expected result, logged out, nothing. Edited May 31, 2014 by digitex Link to comment Share on other sites More sharing options...
teppo Posted May 31, 2014 Share Posted May 31, 2014 What version of PW are you using on this site? I tried setting up a matching scenario locally (PW 2.4.2) and couldn't reproduce this issue. It's always a bit of guesswork trying to test something like that without knowing exactly what your code does, how the pages are organised etc. but at least the most basic scenario seems to work for me. Link to comment Share on other sites More sharing options...
digitex Posted May 31, 2014 Author Share Posted May 31, 2014 What version of PW are you using on this site? I tried setting up a matching scenario locally (PW 2.4.2) and couldn't reproduce this issue. It's always a bit of guesswork trying to test something like that without knowing exactly what your code does, how the pages are organised etc. but at least the most basic scenario seems to work for me. Thanks for the help teppo. PW is V2.4.? I grabbed a fresh copy this afternoon via the latest stable version link on the download page. That says 2.4.0 so don't know if it's as recent as yours. The code is basically the same as here: https://processwire.com/talk/topic/438-stumped-on-two-issues/page-2#entry63268 And it works perfectly as far as I can see, as long as you're logged in. Link to comment Share on other sites More sharing options...
digitex Posted June 2, 2014 Author Share Posted June 2, 2014 Sorry to waste everyone's time. I figured it out after much panic. In my tests I had left include=all out of the selector for the repeater. Without that it was returning results while logged in as a superuser but not when using it as a guest. I finally clued in, added it and suddenly my life is rosy(er) again. Thanks to Craig, CStevens and Teppo for responding to my goofy panic. 4 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now