I have the "The record doesn't have a valid data snapshot" message when I try to access hasChanged
method when I update a model.
here is my controller (somme line are deleted)
In the code below, the hasChanged works only because I added $serie->setSnapshotData($originalData);
but it should not be mandatory to add this manually.
$serie = $seriesService->getSeriesBySlug($slug);
$originalData = $serie->toArray();
$form = new SeriesForm();
$form->setEntity($serie);
try {
if ($this->request->isPost()) {
//...
} else {
$form->bind($this->request->getPost(), $serie);
$seriesService = $this->di->get('SeriesService');
$serie->setSnapshotData($originalData);
$seriesService->saveSeries($serie);
//redirect to addChapter page for this series.
$this->response->redirect('admin/series/');
}
} else {
//GET
}
}
...
Am I doing something wrong ?
Phalcon verison : 3.2.2