Details
Description
Steps to reproduce:
- Create new Content Type with ezstring field and ezobjectrelation field.
- Use Public PHP API (https://doc.ibexa.co/en/2.5/api/public_php_api_creating_content/#creating-content-item-draft) to create a draft of Content Type from step 1 with the invalid relation data, for example:
$contentType = $this->contentTypeService->loadContentTypeByIdentifier('test'); $contentCreateStruct = $this->contentService->newContentCreateStruct($contentType, 'eng-GB'); $contentCreateStruct->setField('new_ezstring_1', 'test'); $contentCreateStruct->setField('new_ezobjectrelation_2', 'testtest'); $locationCreateStruct = $this->locationService->newLocationCreateStruct(2); $draft = $this->contentService->createContent($contentCreateStruct, array($locationCreateStruct));
Result:
The draft was created without any validation when it comes to ezobjectrelation fieldtype.
Expected result:
The exception should be thrown that validation failed, like it's done for other fieldtypes.
Note:
The same problem occurs for ezobjectrelationlist, the only thing which is validated is the number of items allowed to be selected.
The fix will also validate the allowed Content Types which have been set in field type config - this should be tested as well.
https://github.com/ezsystems/ezpublish-kernel/pull/3131#issuecomment-1061955070 -> something to keep an eye on during the QA
Designs
Attachments
Issue Links
- relates to
-
IBX-3445 User is not able to publish Content having relation to not readable Content Object
- Closed