$value_prep = $modx->db->escape($value); //////////////////////////////////////////////////////////////////////////////////// <-добавляем $charset = $modx->config['etomite_charset']; if (mb_detect_encoding($value_prep, "UTF-8, $charset") == 'UTF-8') $value_prep = mb_convert_encoding($value_prep, $charset, "UTF-8"); //////////////////////////////////////////////////////////////////////////////////// if(is_numeric($cv->id)) {
//////////////////////////////////////////////////////////////////////////////////// <-добавляем
$charset = $modx->config[’etomite_charset’];
if (mb_detect_encoding($value_prep, "UTF-8, $charset") == ’UTF-8’)
$value_prep = mb_convert_encoding($value_prep, $charset, "UTF-8");
////////////////////////////////////////////////////////////////////////////////////
Значит нетуда добавили у меня всё прокатило.
//////////////////////////////////////////////////////////////////////////////////// <-добавляем
$charset = $modx->config[’etomite_charset’];
if (mb_detect_encoding($value_prep, "UTF-8, $charset") == ’UTF-8’)
$value_prep = mb_convert_encoding($value_prep, $charset, "UTF-8");
////////////////////////////////////////////////////////////////////////////////////
Добавил ваш код, не помогло, теперь QuickEdit вообще не сохраняет документы, а тупо их перезагружает
// Get the template variable value
foreach($_POST as $post_key=>$post_value) {
if(substr($post_key, 0, 2) == ’tv’) {
$value = $post_value;
}
}
if(is_array($value)) {
$value = implode(’||’, $value);
}
$value_prep = $modx->db->escape($value);
$charset = $modx->config[’etomite_charset’];
if (mb_detect_encoding($value_prep, "UTF-8, $charset") == ’UTF-8’)
$value_prep = mb_convert_encoding($value_prep, $charset, "UTF-8");
if(is_numeric($cv->id)) {
// Define the tmplvars vairable by reference for plugin support
$tmplvars[$cv->id] = &$value_prep;
// invoke OnBeforeDocFormSave event
$modx->invokeEvent(’OnBeforeDocFormSave’, array(’mode’=>’upd’, ’id’=>$doc_id));
$sql = "SELECT id
FROM {$db}.`{$pre}site_tmplvar_contentvalues`
WHERE `tmplvarid` = ’{$cv->id}’
AND `contentid` = ’{$doc_id}’;";
$result = $modx->db->query($sql);