<forum>/search returns 500 error

On my forum and on this forum, if I go to http:// forum address /search I get a 500 error.

Any known workarounds?

Thanks!

2 Likes

Can you give the complete address?

https://meta.discourse.org/search

I’m not sure if this is a correct address for this application, is it? @zogstrip @codinghorror @sam

I’m not 100% sure it worked on this forum before, but it definitely worked on mine: http://talk.sparrowbrowser.com/search

This looks like a legit bug, though not high priority since few people will find themselves here.

If you search for e.g.

Search results for 'community land protection' - Global Legal Empowerment Network Community Discussions

you get results.

But if you visit …

Search results for '' - Global Legal Empowerment Network Community Discussions

… or even …

Search results for '' - Global Legal Empowerment Network Community Discussions

… you get an ugly error.

Would be more sensible to be shown a blank search form ready to be used to search for something.

1 Like

Yeah, using the magnifying glass link works just fine. For us this is an issue because we liked the /search page a lot and are pointing people toward it.

Not what I’m getting using Firefox by a direct click on the link

But if I put the URL into the address bar I get a blank page.

A relative link thing?

Weird, I get a Server 500 error

me too. In Chrome, I get the server 500 error, here on meta and in our community.

Seems that the bug is in chrome, i got and error too.

Interesting to know that it’s browser-dependent!

I can repro this issue locally, working on a fix now.

5 Likes

Fixed via:

https://github.com/discourse/discourse/commit/a7eec3da5c9af2f8d03b65453bdfbad214f05757

Was related to this commit.

cc @sam

6 Likes

Can you explain me how the ‘if result’ works in this case? I will appreciate it a lot.

It will only run find_user_data(guardian) on result, if result has a value. In this case, since you are visitng /search directly, there is no result

2 Likes

Oh i got it! Thanks for the explanation, cheers! I think this post should be closed right?

Yep, search page loads fine now: Search results for '' - Discourse Meta

4 Likes