Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

Archive /

Our old forums are still available as a read-only archive.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo

Site Search - German Site - Problem with Umlaut

Go to End

10 Posts   5660 Views


Community Member, 12 Posts

10 November 2008 at 1:02am

Edited: 10/11/2008 1:58am

Any solution by now?

Generally the search works fine.
With umlaute the previously described "no results" occurs.
However, when you search for the word "möchten" but type "möchten" the search does get the results that contain the word.

I wonder how the data is stored in the database and if the query parameters need to convert characters to html entities before executing the query and also to convert back to correct HTML to get the umlaute issue solved?

Hint: I'm running SS 2.2.3

Executing the sql query "select id, content from SiteTree limit 10;" from shell (not phpMyAdmin) I get confirmed what was written before: the database contains plain HTML code:
<h4>Pflege ist Dienstleistung, </h4> <p>&ouml;de ist langweilig</p>

So I would need to convert the search term using htmlentities() before passing it to the query.

Here is what I did (and it's working):
changed line 76 in sapphire/search/SearchForm.php from

75 public function getResults($numPerPage = 10){
76 $keywords = $_REQUEST['Search'];


75 public function getResults($numPerPage = 10){
76 $keywords = htmlentities($_REQUEST['Search'], ENT_QUOTES, 'UTF-8');

For the results I used the following in template:
<!-- do some decoding here to display results with umlaute etc. correctly -->


Forum Moderator, 801 Posts

10 November 2008 at 4:43am

Thanks for your patch and ideas, Jim! The problem is that we'd break special character searches in all other (unescaped) fields like "Title". There's two existing tickets with partial patches for the problem, we need somebody to write unit tests for the existing functionality before we can proceed with making the searchform i18n-compatible. Shouldn't be too hard, the groundwork is done in the patch. Anyone keen?

Go to Top