Closed ahmed-bhs closed 5 years ago
I'm trying to update a content wish have an eztag field value. I'm flowing the content updatethe documentation section https://doc.ezplatform.com/en/1.7/api/public_php_api_managing_content/#updating-content, unfortunately I'm getting this exception: Content fields did not validate
Content fields did not validate
This is my code:
$content = $this->repository->getContentService()->loadContentByRemoteId('bee932d48db96b7e10fd82ea3d3cfe0c'); $tag1 = $this->tagsService->loadTag(67); $tag2 = $this->tagsService->loadTag(169); $contentUpdateStruct = $this->repository->getContentService()->newContentUpdateStruct(); $contentUpdateStruct->initialLanguageCode = 'fre-FR'; $contentUpdateStruct->setField('eztag_identifier', [$atg1, $tag2]); $contentInfo = $this->repository->getContentService()->loadContentInfo($content->id); $contentDraft = $this->repository->getContentService()->createContentDraft($contentInfo); $contentDraft = $this->repository->getContentService()->updateContent($contentDraft->versionInfo, $contentUpdateStruct); $content = $this->repository->getContentService()->publishVersion($contentDraft->versionInfo);
Any idea would be appreciated.
I'm trying to update a content wish have an eztag field value. I'm flowing the content updatethe documentation section https://doc.ezplatform.com/en/1.7/api/public_php_api_managing_content/#updating-content, unfortunately I'm getting this exception:
Content fields did not validate
This is my code:
Any idea would be appreciated.