If the article has extra fields and global k2 front edit settings is set to not display extra fields tab, then all extra fields flushes after editing it from front end
A possible solution:
1. Wrap a handler into if case
\administrator\components\com_k2\models\item.php 783
if ($params->get('showExtraFieldsTab') || $application->isAdmin()) {
$row->extra_fields = json_encode($objects);
require_once(JPATH_COMPONENT_ADMINISTRATOR.'/models/extrafield.php');
$extraFieldModel = K2Model::getInstance('ExtraField', 'K2Model');
$row->extra_fields_search = '';
foreach ($objects as $object)
{
$row->extra_fields_search .= $extraFieldModel->getSearchValue($object->id, $object->value);
$row->extra_fields_search .= ' ';
}
}
2. Check if extra fields are empty at db update
\administrator\components\com_k2\models\item.php 909
if (!is_null($row->extra_fields))
{
$query .= " extra_fields = ".$db->Quote($row->extra_fields).", extra_fields_search = ".$db->Quote($row->extra_fields_search)." , ";
}
$query .= "published = ".$db->Quote($row->published)." WHERE id = ".$row->id;
$db->setQuery($query);