如所述
this solution
,建议的解决方法在
dev
test
SS环境。
建议的方法是避免当前与通过
DataObject
$owns
财产。
但自从我上传了我的项目在生产上
live
就我而言,我正在做一个
DataExtension
属于
User
模型。其余的实现完全遵循上述案例
UploadField
.
在生产环境中,代码段似乎在其状态中被忽略了。特别是,这是我的版本:
用户扩展
// AllegatiDownload: many_many File type uploaded with UploadField
public function onAfterWrite()
{
if ($this->owner->AllegatiDownloadID) { // <- This is being ignored in live version
$this->owner->AllegatiDownload()->publishSingle();
}
parent::onAfterWrite();
}
如果我想替换
$this->owner->AllegatiDownloadID
$this->owner->AllegatiDownload()
情况过去了,但是
$this->owner->AllegatiDownload()->publishSingle()
出现了一个错误
正如我所说,这只发生在生产中。
提前感谢您的支持。