In some cases (delete of cache files, access to one page and then access to another page) Nette\Database\Table\ActiveRow::accessColumn generates Notice.
I can't write test case because bug is unpredictable.
My temporary solution is edit Nette\Database\Table\Selection::offsetGet, but it's only a hack IMHO (and is applied only to ::offsetGet).
public function offsetGet($key)
{
$this->execute();
// solves strange cache bug
$rows = ($this->rows) ? : $this->data;
return $rows[$key];
}
Another hack is edit Nette\Database\Table\ActiveRow::accessColumn like this:
protected function accessColumn($key, $selectColumn = TRUE)
{
$this->table->accessColumn($key, $selectColumn);
if ($this->table->getDataRefreshed() && !$this->dataRefreshed) {
$row = ($this->table[$this->getSignature()]) ? : $this->table->get($this->getSignature());
$this->data = $row->data;
$this->dataRefreshed = TRUE;
}
}
Related topic in forum:
I can't reproduce issue artifically so I can't write tests and create full pull-request at the moment :(
Codes above are only my "hacks" until we found right cause of the issue.
In some cases (delete of cache files, access to one page and then access to another page)
Nette\Database\Table\ActiveRow::accessColumngenerates Notice.I can't write test case because bug is unpredictable.
My temporary solution is edit
Nette\Database\Table\Selection::offsetGet, but it's only a hack IMHO (and is applied only to ::offsetGet).Another hack is edit
Nette\Database\Table\ActiveRow::accessColumnlike this:Related topic in forum:
I can't reproduce issue artifically so I can't write tests and create full pull-request at the moment :(
Codes above are only my "hacks" until we found right cause of the issue.