3
sonata admin 내에서 문서의 부모를 변경하는 데 문제가 있습니다. 내가 Sonata Doctrine Phpcr Admin 번들 : 노드의 부모 변경
The server returned a "500 Internal Server Error".
The Id is immutable (/cms/content/blog/blog-post-for-12th-october/teaserimage_de.jpg !== /cms/content/blog/blog-post-for-12th-october). Please use DocumentManager::move to move the document: blog post for 12th October (/cms/content/blog/blog-post-for-12th-october)
이 오류가 발생하지만
같은 오류가있어 모든 문서 문서의 부모를 변경하려고/**
* @PHPCRODM\Children(filter="teaserimage*", cascade="persist")
* @var Image[]
*/
protected $teaserImages;
....
/**
* @Validation\PhpcrImage(maxWidth="1500", maxHeight="844", minWidth="600", minHeight="338", minRatio="1.77", maxRatio="1.78", nullable=false)
*
* @return Image|null
*/
public function getTeaserImage()
{
return $this->getLocalizedImage($this->teaserImages, 'teaserimage');
}
/**
* @param Image $image
*/
public function setTeaserImage($image)
{
$this->teaserImages->add(
self::setupImage($image, $this->getLocalizedImageNodeName('teaserimage'), $this->getTeaserImage())
);
}
, 내 문서로 이동되었습니다
내 문서는이 같은 속성이 있습니다 모든 subdocument와 함께 올바른 장소.
이 당신의 preUpdated, prePersists 방법을 확인 https://gist.github.com/milosnovi/a83f400c8ff06b4de6dd96e1f149a8dd
문서 관리자의 move() 함수를 사용하려고 했습니까? 당신이 GUI에서 움직일 때 소나타 관리자가 무엇을하는지 알아 내려고 할 수 있습니까? 그것은 이동 기능이 아닌 다른 것을 사용하고 있습니까? – dbu