0

Description of Problem: There is a site on the Revo 2.4.2. Babel Installed with three contexts (Ru, Ua, En). Installed SimpleSearch 1.9.2. The problem is the inability to look cyrillic word (nothing found). Latin search is correct. Everywhere set UTF-8.

Expected Outcome: Start searching russian symbols.

  • MODX Version: 2.4.2
  • PHP Version: 5.4.45
  • Database Version: 5.5.46
  • Installed MODX Add-ons: Ace, Archivist, Articles, Babel, BreadCrumb, FAQ Manager, filedownload, getPage, getResources, GoogleSiteMap, MetaX, modxtalks, phpThumbOf, Quip, SimpleSearch, taglister, TinyMCE, translit
  • Error Log Contents: nothing.

Form:

[[!SimpleSearchForm? &method=`GET` &landing=`[[++searchlid]]` &tpl=`lisearch` &searchIndex=`query`]]

searchlid - different for each context.

lisearch:

<form class="search" action="[[~[[+landing:default=`[[*id]]`]]]]" method="[[+method:default=`get`]]">
       <input type="text" placeholder="[[%babel.placeholder_[[++cultureKey]]]]" name="[[+searchIndex]]" id="[[+searchIndex]]"/>
                            <input type="submit" id="search_btn" value=""/>
                            <input type="hidden" name="id" value="[[+landing:default=[[*id]]]]" />
</form>

mysql> show variables like 'char%';

+--------------------------+----------------------------+
| Variable_name            | Value                      |
+--------------------------+----------------------------+
| character_set_client     | utf8                       |
| character_set_connection | utf8                       |
| character_set_database   | utf8                       |
| character_set_filesystem | binary                     |
| character_set_results    | utf8                       |
| character_set_server     | utf8                       |
| character_set_system     | utf8                       |
| character_sets_dir       | /usr/share/mysql/charsets/ |
+--------------------------+----------------------------+
8 rows in set (0.03 sec)

mysql> show variables like 'collation%';

+----------------------+-----------------+
| Variable_name        | Value           |
+----------------------+-----------------+
| collation_connection | utf8_general_ci |
| collation_database   | utf8_unicode_ci |
| collation_server     | utf8_unicode_ci |
+----------------------+-----------------+
3 rows in set (0.00 sec)

In template:

<meta charset="utf-8"/>
<meta http-equiv="content-language" content="ru" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

What could be the problem?

Thank you in advance.

Roman Sobol
  • 85
  • 1
  • 7

2 Answers2

1

Could you look for the database table and field collations? They have to use all UTF8 and utf_general_ci or utf8_unicode_ci.

Another problem could be caused by UTF-8 chars encoded as html entities in rich text fields. Maybe that entities are not found because only a raw search is done (I don't know how simple search prepares the search).

A third issue could be caused by a wrong html charset in the template. This would cause wrong characters in the posted search string.

Jako
  • 832
  • 5
  • 11
  • Added code. How to check encoding in rich text fields? – Roman Sobol Jan 10 '16 at 19:08
  • Open the the rich text editor in HTML mode or quick edit the resource, if you see html entities instead of cyrillic signs, this could be the issue. – Jako Jan 10 '16 at 23:33
  • I do not see any database table field information in your dumps above. Could you i.e. execute **mysql> SHOW CREATE TABLE `modx_site_content`** and look if there are any other charsets than utf8 in the output. – Jako Jan 10 '16 at 23:42
  • Text editor seems not caused problems. Command show: ENGINE=MyISAM AUTO_INCREMENT=5573 DEFAULT CHARSET=utf8. – Roman Sobol Jan 11 '16 at 17:41
  • The command should have showed some more lines. Are there any other charsets used in the fields? – Jako Jan 12 '16 at 14:02
0

Surprisingly, the problem was resolved removal from the snippet parameters. I do not know what it is connected.

A working version:

[[!SimpleSearchForm? &landing=`[[++searchlid]]` &tpl=`lisearch`]]

and just

[[!SimpleSearch]]

on landind page.

Roman Sobol
  • 85
  • 1
  • 7