Details
-
Bug
-
Resolution: Invalid
-
High
-
None
-
5.0.x-dev, 4.6.7
-
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
- Create a migration for a content [1]
a. content create mode
b. content update mode - Make a content validation-level mistake by e.g.: making a required value empty
- 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.