So these lines in the .htaccess in the site root were problem:
RewriteRule ^(.*)/htmlarea/(.*)$ /htmlarea/$2
RewriteRule ^(.*)htmlarea(.*)$ - [S=1]
Other elements of the site also used htmlarea. The purpose of these lines were to clean up URL.
This directed HTMLarea of Moodle to connect to wrong database
No our HTMLeditor works.