Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search function doesn’t work for anonymous


  • AntonHoelstad
    Participant

    @antonhoelstad

    Hi,

    I have a weird problem that I really hope someone here can help me with. I’ve tried everything I can figure out myself – but I need someone with more knowledge to help me figure out the solution.

    When I search as logged in as myself, everything works correct. Let’s say you would search for the phrase “adwords” – I get to this page with one result: http://antonhoelstad.dk/soeg/adwords/

    But when I go incognito, and try to do exactly the same as I were anonymous, the url I land on after a search is this instead: http://antonhoelstad.dk/soeg/?action=bbp-search-request&bbp_search=adwords

    Two completely different URLs, but the same search and procedure. Only difference is that it works for me as a logged in administrator, but not for everyone else.

    Does anybody know how I can fix this issue?

    I’ve tried:
    1. Disabeling all plugins and using the standard theme
    2. Resetting the permalink structure
    3. Deleted and set up the BBpress plugin from scratch
    4. And a lot more

    None of it worked unfortunately 🙁

    Maybe it’s possible with a redirect in the .htaccess to remove the part of the url that doesn’t work (“?action=bbp-search-request&bbp_search=”)?

    I will really appreciate anyone that can help me here!

Viewing 13 replies - 1 through 13 (of 13 total)

  • Robkk
    Moderator

    @robkk

    I cannot reproduce this issue on my site, incognito works fine for me.

    I can definitely reproduce on your site though, incognito or not.

    You first try using the forum root slug in Settings > Forums to see if that fixes anything.


    AntonHoelstad
    Participant

    @antonhoelstad

    Hi Robkk,

    Thanks for your suggestion. I did try this too though, and it doesn’t help unfortunately. I must have broken something somehow.

    How does the search URL string look on your site? Does it look like either of mine?


    Robkk
    Moderator

    @robkk

    When I tested it, it doesn’t have the extra added query ?action=bbp-search-request&bbp_search=” like your site does.

    I also tested it with/without the forum root slug and it worked fine for me.


    AntonHoelstad
    Participant

    @antonhoelstad

    But I’m not sure what to do here. Any suggestions?


    Robkk
    Moderator

    @robkk

    Okay I found a few fixes for this possible bug, I will need to contact the devs later to see if they had seen something similar before. One is an htaccess rewrite rule and the other is really something simple.

    Okay you can try the trailing slash fix mentioned here first to see if it helps, but you are not really experiencing a 404 error because the search term you are searching is stripped for some reason.

    bbPress 2.4 // ERROR // Search stopped working…

    As a test try setting your permalinks to default and try searching again to see if it will keep your search term and search for it. The query search?action=bbp-search-request&bbp_search=adwords is usually seen in the default permalink structure instead of /search.

    Also make sure you do not have a trailing slash in any of the slugs in Settings>Forums.

    The htaccess rewrite method is adding this to your htaccess file on your site that is uaually in the WordPress directory to solve the issue, but do not try this just yet, I don’t want you messing with your htaccess file

     # BEGIN bbpress search hack
    <IfModule mod_rewrite.c>
    	RewriteEngine On
    	RewriteCond %{QUERY_STRING} ^action=(.*)&bbp_search=(.*)$
    	RewriteRule ^/soeg/(.*)$ http://antonhoelstad.dk/soeg/%2/? [L]
    </IfModule>
    # END bbpress search hack

    AntonHoelstad
    Participant

    @antonhoelstad

    Good suggestions I must say! But unfortunately none of these worked either. Let me go trough them one by one:

    1. I set the permalink structure back to default. The only change here is, that when you search now, and land on the URL string “search?action=bbp-search-request&bbp_search=adwords” – you now see the frontpage for some weird reason?
    2. I have no trailing slash in the settings part of the forum
    3. I did try the htaccess hack – but this did no change? I still see the frontpage now when I try to search.

    Something weird is going on. Would it help you if I send you the code for some of the files for my plugin?


    AntonHoelstad
    Participant

    @antonhoelstad

    I have been changing a bit of translations in the code – that’s why you might find a mistake here. What I don’t understand is, that when I upload all the original files, it still does the same mistake.

    Is there one or a few of the files that determine this part with the URL? Because then I could show you those, and we could see if something was wrong here?


    Robkk
    Moderator

    @robkk

    I have been changing a bit of translations in the code – that’s why you might find a mistake here.

    You haven’t been editing core files right?? There are other ways you can translate bbPress, unless you are just editing the templates that you can copy into your child theme?

    There might be another thing you could do if you haven’t already, place all the bbPress templates in a child theme of theme in a folder called bbpress.

    Theme Compatibility

    Also remove the htaccess hack since it seems not to work. I don’t want it causing issues.


    AntonHoelstad
    Participant

    @antonhoelstad

    What do you mean about core files?

    I’ve never used child themes before, so I’m not sure how to do this.

    Can’t you tell me if there’s some specific files that I should re-upload as original, in case I’ve changed something in them?

    Or second option: Could you rewrite the htaccess hack so it might work? 🙂

    Your help is highly appreciated by the way!


    Robkk
    Moderator

    @robkk

    I have been changing a bit of translations in the code – that’s why you might find a mistake here. What I don’t understand is, that when I upload all the original files, it still does the same mistake.

    Can’t you tell me if there’s some specific files that I should re-upload as original, in case I’ve changed something in them?

    What files did you edit, if you did edit any files?? I hope you did not edit the bbPress plugin files in the plugin directory of your site??

    I’ve never used child themes before, so I’m not sure how to do this.

    This will help you learn about creating a child theme.

    https://codex.wordpress.org/Child_Themes

    After creating the child theme just copy the bbPress templates to your child theme in a folder called bbpress.

    Or second option: Could you rewrite the htaccess hack so it might work? 🙂

    You really shouldn’t need an htaccess hack at all, that is why I said don’t use it yet.


    AntonHoelstad
    Participant

    @antonhoelstad

    Now I’ve tried again from the very beginning, with all the original files for the plugin etc. It has the exact same issue – which means that the problem must be in one of the following files coding – since these are the only ones with the “bbp-search-request” and/or “bbp_search” in it.

    Can you see any problems or issues with these files?

    templates/default/bbpress/form-search.php

    https://gist.github.com/anonymous/496fd16abe6f4188e4a0

    includes/search/functions.php

    https://gist.github.com/anonymous/bdb60f2e51201ffb2cf5

    includes/core/actions.php

    https://gist.github.com/anonymous/7eed8ef36becd703a5a7

    bbpress.php

    https://gist.github.com/anonymous/626d687f57dfaaa257ca

    templates/default/bbpress/loop-search.php

    https://gist.github.com/anonymous/83570d171156e157fb3d

    includes/core/options.php

    https://gist.github.com/anonymous/10fe8cfcaa4518241184

    includes/admin/settings.php

    https://gist.github.com/anonymous/bad7e43a34fe3e9a7428

    includes/common/shortcodes.php

    https://gist.github.com/anonymous/daa4af269bcf8613a871

    includes/core/template-functions.php

    https://gist.github.com/anonymous/94e2f94a2e0cca8f18f4

    includes/search/template.php

    https://gist.github.com/anonymous/25e84781cab341c71496


    AntonHoelstad
    Participant

    @antonhoelstad

    No one able to help me with this one? 🙁


    Robkk
    Moderator

    @robkk

    @antonhoelstad

    All you had to say was that you did not edit files, if you did not edit any files.

    You did not need to post ALL of the code in the templates that just included any specific keywords to search. If you started fresh from on bbPress then you just posted the default templates.

    Do not post full template code, on this site use soemthing like gist.github so I do not have to scroll through all of that in this topic, or even in the forums search on this site.

    Did you even try putting the templates into a child theme like I said above??

Viewing 13 replies - 1 through 13 (of 13 total)
  • You must be logged in to reply to this topic.
Skip to toolbar