Yii 1.1.17
mysql
[color="#FF0000"]It shows that the save() when executed properly to update a model. No error, no validation error, return true… nothing… the record is intact, it was never updated.[/color]
It was working for years but for some reason, it’s stop updating models.
This problem only occur in FEW PARTICULAR ACTIONS. When I try the save() operation anywhere else it works without problem.
public function actionEditExtraCharge( $id )
{
$extraCharge = TENANT_ExtraCharge::model()->findByPk( $id );
if( isset($extraCharge) )
{
if( isset($_POST["TENANT_ExtraCharge"]) )
{
$extraCharge->attributes = $_POST["TENANT_ExtraCharge"];
$extraCharge->save(false);
}
$this->render( "editExtraCharge", [ "extraCharge" => $extraCharge,
} else {
throw new CHttpException(500, "Cannot find the record: " . $id);
}
}
[color="#0000FF"]
[list=1]
[*] When I dump $extraCharge->getErrors() after save() I get an empty array (NO VALIDATION ERROR);
[*] I checked for any overwrite of beforeSave() or beforeValidate()… there’s NONE
[*] When I try to force an $extraCharge->insert() it will work or save() with a new record it will work.
[*] If I try to force an $extraCharge->update() or $extraCharge->updateByPk($extraCharge->getOldPrimaryKey(),$extraCharge->getAttributes()); It will NOT WORK.
[*] I only have this problem with only 2 models TENANT_ExtraCharge and TENANT_MainCat… I have commented any non-vital functions, but still…
[/list][/color]
I’ve been searching this problem for 3 days now… I’m about to jump through the fuc***g window.
ANY suggestion is welcome.
Thank you for your time.