Details
-
Bug
-
Resolution: Fixed
-
High
-
5.4.8
-
None
Description
Steps to reproduce
- Find or create a new content type with at least on integer attribute
- Leave the values for Min integer value and Max integer value to Empty
- Run the sample code below on a Command script, passing the class identifier as argument.
Expected result
Min integer value and Max integer value should both be set to empty
Actual result
Min integer value and Max integer value are both set to zero, meaning zero is now the only value that will validate in that field.
Sample code:
protected function configure() { $this->setName('ez:support:update_type') ->setDefinition( array( new InputArgument('contentType', InputArgument::REQUIRED, 'Content type to update'), ) ) ->setDescription('Updates a content type'); } protected function execute(InputInterface $input, OutputInterface $output) { $repository = $this->getContainer()->get('ezpublish.api.repository'); // set admin as current user $user = $repository->getUserService()->loadUser( 14 ); $repository->setCurrentUser( $user ); /** @var \eZ\Publish\API\Repository\ContentTypeService $contentTypeService */ $contentTypeService = $repository->getContentTypeService(); $contentType = $contentTypeService->loadContentTypeByIdentifier( $input->getArgument('contentType') ); $contentTypeDraft = $contentTypeService->createContentTypeDraft($contentType); $contentTypeUpdateStruct = $contentTypeService->newContentTypeUpdateStruct(); $contentTypeUpdateStruct->mainLanguageCode = 'eng-GB'; $contentTypeService->updateContentTypeDraft($contentTypeDraft, $contentTypeUpdateStruct); $contentTypeService->publishContentTypeDraft($contentTypeDraft); }
Attachments
Issue Links
- relates to
-
EZP-24533 Float FieldType has wrong default validator values
- Closed