Commit 5fc033a4 authored by Martin Gregor's avatar Martin Gregor
Browse files

oprava neexistujucich atributov

parent 93c7c13b
......@@ -113,7 +113,7 @@ class HomepagePresenter extends BasePresenter
foreach ($sentences as $id => $values)
{
if ($values['type'] == 'incorrect' && (isset($values['words']) || isset($values['note'])))
if (isset($values['type']) && $values['type'] == 'incorrect' && (isset($values['words']) || isset($values['note'])))
{
$tmp = $this->db->table('translations')->get($id);
$tmp = explode(' ',$tmp->translation);
......@@ -122,6 +122,10 @@ class HomepagePresenter extends BasePresenter
$tmp[$position] = $word;
}
$correction = implode(' ',$tmp);
if (!isset($values['note']))
{
$values['note'] = null;
}
$this->storeCorrection($id,$correction,$values['words'],$values['note']);
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment