public function executeProductAllAccept()
{
$this->observation = ObservationPeer::retrieveByPK($this->getRequestParameter('id'));
$this->forwardUnless((
$this->observation
), 'observation', 'error');
$this->redirectUnless((
$this->product
), 'observation/error?flag=insufficientrights');
$currentTime = date('Y-m-d H:i:s');
//echo $currentTime.'<br />';
$this->observation->setIsSentBackToPM(0);
//echo 'after setIsSentBackToPM'.'<br />';
$this->observation->setIsPartAccepted(0);
//echo 'after setIsPartAccepted'.'<br />';
$this->observation->setIsHold(1);
//echo 'after setIsHold'.'<br />';
$this->observation->setCostAllAcceptanceTime($currentTime);
//echo 'after setCostAllAcceptanceTime'.'<br />';
$this->observation->save();
//echo 'after save'.'<br />';
//exit;
return $this->redirect('observation/myObservations');
}
此代码返回一个空白页。在开发环境中尝试过-> 再次空白页。
所以我添加了一些回声来测试它到底在哪里失败了。输出是:
2013-06-03 10:40:20
after setIsSentBackToPM
after setIsPartAccepted
after setIsHold
after setCostAllAcceptanceTime
所以这在执行 save() 时显然会失败。
查看 symfony 日志:
- 没有错误
- 仅关于 SELECT 查询的 [信息]
- 没有关于 SET 查询的 [信息](所以在 symfony 尝试执行查询之前 save() 中的某些内容失败了)
查看apache错误日志->没有错误。
所以我尝试重建保存方法-> symfony propel-build-model。但问题依然存在。我将 BaseObservation 的保存方法与其他模型的保存方法进行了比较 -> 我没有发现任何异常。
我不知道如何追踪这个。有任何想法吗?
编辑:更新测试:
public function executeProductAllAccept()
{
$this->observation = ObservationPeer::retrieveByPK($this->getRequestParameter('id'));
echo 'before test plain save'.'<br />';
$this->observation->save();
echo 'after test plain save'.'<br />';
$this->forwardUnless((
$this->observation
), 'observation', 'error');
$this->redirectUnless((
$this->product
), 'observation/error?flag=insufficientrights');
$currentTime = date('Y-m-d H:i:s');
echo $currentTime.'<br />';
$this->observation->setIsSentBackToPM(0);
echo 'after setIsSentBackToPM'.'<br />';
$this->observation->setIsPartAccepted(0);
echo 'after setIsPartAccepted'.'<br />';
$this->observation->setIsHold(1);
echo 'after setIsHold'.'<br />';
$this->observation->setCostAllAcceptanceTime($currentTime);
echo 'after setCostAllAcceptanceTime'.'<br />';
$this->observation->save();
echo 'after save'.'<br />';
exit;
return $this->redirect('observation/myObservations');
}
回报:
before test plain save
after test plain save
2013-06-03 10:40:20
after setIsSentBackToPM
after setIsPartAccepted
after setIsHold
after setCostAllAcceptanceTime