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

[Migrations] Content Create/Update migrations don't display full validation error message

    XMLWordPrintable

Details

    • Icon: Bug Bug
    • Resolution: Invalid
    • Icon: High High
    • None
    • 5.0.x-dev, 4.6.7
    • Experience, Migrations
    • None
    • Ibexa Experience

    Description

      For failed content create or update migrations, when a migration ends with

      Content fields did not validate

      error output, it's difficult to track down the root cause of the issue, especially when working with multiple migration files.

      Steps to reproduce

      1. Create a migration for a content [1]
        a. content create mode
        b. content update mode
      2. Make a content validation-level mistake by e.g.: making a required value empty
      3. Execute that migration (e.g.: follow "Importing Data" section)

      Actual behavior

      Observe that you get simply:

      In ContentService.php
                                         
        Content fields did not validate
      

      without any extra context.

      Expected behavior

       You should see more verbose information

      In ContentFieldValidationException.php:
                                                    
        Content "" fields did not validate:         
        - The file size cannot exceed 1 megabytes. 
      
      In ContentService.php:
                                         
        Content fields did not validate 
      

      [1] Creating a migration file can be done by e.g. adding an arbitrary content item via AdminUI and then dumping it into migration file.

      php bin/console ibexa:migrations:generate --type=content --mode=create --match-property=content_remote_id --value=<YourContentRemoteId> 

      Then you need to reset the database:

      php bin/console doctrine:database:drop --if-exists --force
      rm -rf ./var/cache/*/ ./config/graphql
      php bin/console ibexa:install
      php bin/console ibexa:graphql:generate-schema
      

      and then follow the next step.
       

      Designs

        Attachments

          Activity

            People

              Unassigned Unassigned
              andrew.longosz@ibexa.co Andrew Longosz
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: