Re: 外部フォームからExpressへのファイル保存について

2021年5月28日 at 14:25

添付ファイルをファイルマネージャから選択して、
Expressエントリーとして登録すると、

Expected value of type "Concrete\Core\Entity\File\File" for association field "Concrete\Core\Entity\Attribute\Value\Value\ImageFileValue#$file", got "string" instead.

のエラーが出ました。
ただし、Expressにはデータは正常に保存されております。
このエラーは何を意味するのでしょうか?

デバッグでは
public static function invalidAssociation(ClassMetadata $targetClass, $assoc, $actualValue)
{
$expectedType = 'Doctrine\Common\Collections\Collection|array';

if (($assoc['type'] & ClassMetadata::TO_ONE) > 0) {
$expectedType = $targetClass->getName();
}

return new self(sprintf(
'Expected value of type "%s" for association field "%s#$%s", got "%s" instead.',
$expectedType,
$assoc['sourceEntity'],
$assoc['fieldName'],
is_object($actualValue) ? get_class($actualValue) : gettype($actualValue)
));
}
のボールド部分がハイライトされております。

タグ: