Uploaded image for project: 'eZ Publish / Platform'
  1. eZ Publish / Platform
  2. EZP-19863

publicAPI : Field identifier and names[] is wiped out when calling $contentTypeService->newFieldDefinitionUpdateStruct()

    XMLWordPrintable

Details

    Description

      As subject says, field identifier and names[] is wiped out when calling $contentTypeService->newFieldDefinitionUpdateStruct()

              $titleUpdateStruct = $contentTypeService->newFieldDefinitionUpdateStruct();
              $titleFieldDefinition = $contentTypeDraft->getFieldDefinition( 'title' );
      
              $titleUpdateStruct->descriptions = array(
                   $this->api->lang => 'Title of the blog post UPDATED',
              );
              
              $contentTypeService->updateFieldDefinition( $contentTypeDraft, $titleFieldDefinition ,$titleUpdateStruct );
      

      The description is updated, all right....

      However, values for name and idenifier is wiped out when the updated content
      type is published..

      As a workaround, I have to add this before updateFieldDefinition()
      in order to make it work:

      $titleUpdateStruct->names = array(
             $this->api->lang => 'Title',
      );
      $titleUpdateStruct->identifier = 'title';
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            bertrand.dunogier@ibexa.co Bertrand Dunogier
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 hour
                1h