Uploaded image for project: 'Ibexa IBX'
  1. Ibexa IBX
  2. IBX-780

Content Create requires "locationRemoteId" despite allowing null

    XMLWordPrintable

Details

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Medium Medium
    • 3.3.7
    • 3.3.6
    • Content
    • None

    Description

      Migrate command crashes when locationRemoteId is undefined.

      Migration file:

      -
          type: content_type
          mode: create
          metadata:         
              identifier: some_content_type_foo
              mainTranslation: eng-GB
              creatorId: 14
              nameSchema: '<short_title|title>'
              container: true
              defaultAlwaysAvailable: false
              defaultSortField: 1
              defaultSortOrder: 1
              contentTypeGroups: 
                   - Content
              translations: 
                   eng-GB: 
                       name: CONTENT TYPE TO REMOVE
          fields: 
               -
                  identifier: title
                  type: ezstring
                  position: 1
                  translations: 
                       eng-GB: 
                           name: Title
                  required: true
                  searchable: true
                  infoCollector: false
                  translatable: true
                  category: ''
                  defaultValue: 'New content type foo'
                  fieldSettings: {  }
                  validatorConfiguration: 
                       StringLengthValidator: 
                           maxStringLength: 255
                           minStringLength: null
              -
                  identifier: short_title
                  type: ezstring
                  position: 2
                  translations: 
                       eng-GB: 
                           name: 'Short title'
                  required: false
                  searchable: true
                  infoCollector: false
                  translatable: true
                  category: ''
                  defaultValue: null
                  fieldSettings: {  }
                  validatorConfiguration: 
                       StringLengthValidator: 
                           maxStringLength: 255
                           minStringLength: null
      
      -
          type: content
          mode: create
          metadata: 
              contentType: some_content_type_foo
              mainTranslation: eng-GB
              alwaysAvailable: true
              section: 1
          location: 
              locationRemoteId: ~
              hidden: false
              sortField: !php/const eZ\Publish\API\Repository\Values\Content\Location::SORT_FIELD_NAME
              sortOrder: ASC
              priority: 0
              parentLocationId: 1
          fields: 
               -  fieldDefIdentifier: title
                  languageCode: eng-GB
                  value: Title foo
              -   fieldDefIdentifier: short_title
                  languageCode: eng-GB
                  value: Short Title foo
      
      

      Stacktrace:

      php bin/console ibexa:migrations:migrate -vv
      
      10:23:08 NOTICE    [app] Executing migration: "create_content_type.yaml"
      
      10:23:08 INFO      [app] Processing step: 0
      
      10:23:08 INFO      [app] Type "content_type" | Mode: "create" | Matching step: "Ibexa\Platform\Migration\ValueObject\Step\ContentTypeCreateStep"
      
      10:23:08 NOTICE    [app] Added content type: "some_content_type_foo" (ID: 52)
      
      10:23:08 INFO      [app] Processing step: 1
      
      10:23:08 INFO      [app] Type "content" | Mode: "create" | Matching step: "Ibexa\Platform\Migration\ValueObject\Step\ContentCreateStep"
      
      
      
      In MigrationExecutor.php line 71:
      
                                                                                     
        [Ibexa\Platform\Contracts\Migration\Exception\UnhandledMigrationException]   
        Failed denormalizing Step 1. Notice: Undefined index: locationRemoteId       
                                                                                     
      
      
      Exception trace:
      
        at /home/steveb/PhpstormProjects/ibexa-migrations/src/lib/MigrationExecutor.php:71
      
       Ibexa\Platform\Migration\MigrationExecutor->execute() at /home/steveb/PhpstormProjects/ibexa-migrations/src/lib/MigrationService.php:181
      
       Ibexa\Platform\Migration\MigrationService->doExecuteMigration() at /home/steveb/PhpstormProjects/ibexa-migrations/src/lib/MigrationService.php:117
      
       Ibexa\Platform\Migration\MigrationService->executeOne() at /home/steveb/PhpstormProjects/ibexa-migrations/src/bundle/Command/MigrateCommand.php:118
      
       Ibexa\Platform\Bundle\Migration\Command\MigrateCommand->execute() at /home/steveb/PhpstormProjects/ibexa-commerce/vendor/symfony/console/Command/Command.php:299
      
       Symfony\Component\Console\Command\Command->run() at /home/steveb/PhpstormProjects/ibexa-commerce/vendor/symfony/console/Application.php:996
      
       Symfony\Component\Console\Application->doRunCommand() at /home/steveb/PhpstormProjects/ibexa-commerce/vendor/symfony/framework-bundle/Console/Application.php:96
      
       Symfony\Bundle\FrameworkBundle\Console\Application->doRunCommand() at /home/steveb/PhpstormProjects/ibexa-commerce/vendor/symfony/console/Application.php:295
      
       Symfony\Component\Console\Application->doRun() at /home/steveb/PhpstormProjects/ibexa-commerce/vendor/symfony/framework-bundle/Console/Application.php:82
      
       Symfony\Bundle\FrameworkBundle\Console\Application->doRun() at /home/steveb/PhpstormProjects/ibexa-commerce/vendor/symfony/console/Application.php:167
      
       Symfony\Component\Console\Application->run() at /home/steveb/PhpstormProjects/ibexa-commerce/bin/console:43
      
      
      
      In StepsDenormalizer.php line 71:
      
                                                                                                 
        [Ibexa\Platform\Bundle\Migration\Serializer\Denormalizer\StepDenormalizationException]   
        Failed denormalizing Step 1. Notice: Undefined index: locationRemoteId                   
                                                                                                 
      
      
      Exception trace:
      
        at /home/steveb/PhpstormProjects/ibexa-migrations/src/bundle/Serializer/Denormalizer/StepsDenormalizer.php:71
      
       Ibexa\Platform\Bundle\Migration\Serializer\Denormalizer\StepsDenormalizer->denormalize() at /home/steveb/PhpstormProjects/ibexa-migrations/src/lib/MigrationExecutor.php:62
      
       Ibexa\Platform\Migration\MigrationExecutor->execute() at /home/steveb/PhpstormProjects/ibexa-migrations/src/lib/MigrationService.php:181
      
       Ibexa\Platform\Migration\MigrationService->doExecuteMigration() at /home/steveb/PhpstormProjects/ibexa-migrations/src/lib/MigrationService.php:117
      
       Ibexa\Platform\Migration\MigrationService->executeOne() at /home/steveb/PhpstormProjects/ibexa-migrations/src/bundle/Command/MigrateCommand.php:118
      
       Ibexa\Platform\Bundle\Migration\Command\MigrateCommand->execute() at /home/steveb/PhpstormProjects/ibexa-commerce/vendor/symfony/console/Command/Command.php:299
      
       Symfony\Component\Console\Command\Command->run() at /home/steveb/PhpstormProjects/ibexa-commerce/vendor/symfony/console/Application.php:996
      
       Symfony\Component\Console\Application->doRunCommand() at /home/steveb/PhpstormProjects/ibexa-commerce/vendor/symfony/framework-bundle/Console/Application.php:96
      
       Symfony\Bundle\FrameworkBundle\Console\Application->doRunCommand() at /home/steveb/PhpstormProjects/ibexa-commerce/vendor/symfony/console/Application.php:295
      
       Symfony\Component\Console\Application->doRun() at /home/steveb/PhpstormProjects/ibexa-commerce/vendor/symfony/framework-bundle/Console/Application.php:82
      
       Symfony\Bundle\FrameworkBundle\Console\Application->doRun() at /home/steveb/PhpstormProjects/ibexa-commerce/vendor/symfony/console/Application.php:167
      
       Symfony\Component\Console\Application->run() at /home/steveb/PhpstormProjects/ibexa-commerce/bin/console:43
      
      
      
      In LocationNormalizer.php line 36:
      
                                                    
        [ErrorException]                            
        Notice: Undefined index: locationRemoteId   
                                                    
      
      
      Exception trace:
      
        at /home/steveb/PhpstormProjects/ibexa-migrations/src/bundle/Serializer/Normalizer/LocationNormalizer.php:36
      
       Ibexa\Platform\Bundle\Migration\Serializer\Normalizer\LocationNormalizer->denormalize() at /home/steveb/PhpstormProjects/ibexa-commerce/vendor/symfony/serializer/Serializer.php:208
      
       Symfony\Component\Serializer\Serializer->denormalize() at /home/steveb/PhpstormProjects/ibexa-migrations/src/bundle/Serializer/Normalizer/Step/ContentCreateStepNormalizer.php:88
      
       Ibexa\Platform\Bundle\Migration\Serializer\Normalizer\Step\ContentCreateStepNormalizer->denormalize() at /home/steveb/PhpstormProjects/ibexa-commerce/vendor/symfony/serializer/Serializer.php:208
      
       Symfony\Component\Serializer\Serializer->denormalize() at /home/steveb/PhpstormProjects/ibexa-migrations/src/bundle/Serializer/Denormalizer/StepDenormalizer.php:70
      
       Ibexa\Platform\Bundle\Migration\Serializer\Denormalizer\StepDenormalizer->denormalize() at /home/steveb/PhpstormProjects/ibexa-commerce/vendor/symfony/serializer/Serializer.php:208
      
       Symfony\Component\Serializer\Serializer->denormalize() at /home/steveb/PhpstormProjects/ibexa-migrations/src/bundle/Serializer/Denormalizer/ReferenceResolutionDenormalizer.php:63
      
       Ibexa\Platform\Bundle\Migration\Serializer\Denormalizer\ReferenceResolutionDenormalizer->denormalize() at /home/steveb/PhpstormProjects/ibexa-commerce/vendor/symfony/serializer/Serializer.php:208
      
       Symfony\Component\Serializer\Serializer->denormalize() at /home/steveb/PhpstormProjects/ibexa-migrations/src/bundle/Serializer/Denormalizer/StepsDenormalizer.php:55
      
       Ibexa\Platform\Bundle\Migration\Serializer\Denormalizer\StepsDenormalizer->denormalize() at /home/steveb/PhpstormProjects/ibexa-migrations/src/lib/MigrationExecutor.php:62
      
       Ibexa\Platform\Migration\MigrationExecutor->execute() at /home/steveb/PhpstormProjects/ibexa-migrations/src/lib/MigrationService.php:181
      
       Ibexa\Platform\Migration\MigrationService->doExecuteMigration() at /home/steveb/PhpstormProjects/ibexa-migrations/src/lib/MigrationService.php:117
      
       Ibexa\Platform\Migration\MigrationService->executeOne() at /home/steveb/PhpstormProjects/ibexa-migrations/src/bundle/Command/MigrateCommand.php:118
      
       Ibexa\Platform\Bundle\Migration\Command\MigrateCommand->execute() at /home/steveb/PhpstormProjects/ibexa-commerce/vendor/symfony/console/Command/Command.php:299
      
       Symfony\Component\Console\Command\Command->run() at /home/steveb/PhpstormProjects/ibexa-commerce/vendor/symfony/console/Application.php:996
      
       Symfony\Component\Console\Application->doRunCommand() at /home/steveb/PhpstormProjects/ibexa-commerce/vendor/symfony/framework-bundle/Console/Application.php:96
      
       Symfony\Bundle\FrameworkBundle\Console\Application->doRunCommand() at /home/steveb/PhpstormProjects/ibexa-commerce/vendor/symfony/console/Application.php:295
      
       Symfony\Component\Console\Application->doRun() at /home/steveb/PhpstormProjects/ibexa-commerce/vendor/symfony/framework-bundle/Console/Application.php:82
      
       Symfony\Bundle\FrameworkBundle\Console\Application->doRun() at /home/steveb/PhpstormProjects/ibexa-commerce/vendor/symfony/console/Application.php:167
      
       Symfony\Component\Console\Application->run() at /home/steveb/PhpstormProjects/ibexa-commerce/bin/console:43
      
      

      Designs

        Attachments

          Activity

            People

              Unassigned Unassigned
              pawel.niedzielski@ibexa.co Paweł Niedzielski
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: