8
Humm, weird that it is not consistent.
However I'm puzzled by the end of the insert function in class/category.php
if ($category->isNew()) {
$category->assignVar('categoryid', $this->db->getInsertId());
}
$category->assignVar('categoryid', $categoryid);
return true;
When the category object is new then the autoincrement id is asked on MySQL. But then this is overwritten by the $categoryid variable, which is not defined.
Conclusion: it should never work.
How to repair?
You could assume that for an existing object the $categoryObj->categoryid() should be defined and then the last assign could be put in comment.
// $category->assignVar('categoryid', $categoryid);
If it has some function, then it should be in an else
}
else
{
$category->assignVar('categoryid', $categoryid);
}
or the if should set the variable.
$categoryid = $this->db->getInsertId();