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()

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: High High
    • Resolution: Duplicate
    • Affects Version/s: 5.0.0-dev
    • Component/s: None
    • Labels:
      None

      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';

        Issue Links

          Activity

          Hide
          Vidar Langseid added a comment -

          It is not only identifier and names[] which is wiped out.
          Everything, like fieldSettings, isRequired, isInfoCollector etc is also reset....

          Show
          Vidar Langseid added a comment - It is not only identifier and names[] which is wiped out. Everything, like fieldSettings, isRequired, isInfoCollector etc is also reset....
          Show
          Petar Spanja (Inactive) added a comment - Fixed in https://github.com/ezsystems/ezp-next/commit/07b09de68bf35ce3027ef955a2317c1f6d9c2d96

            People

            • Assignee:
              Unassigned
              Reporter:
              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