Description
The RelationList field type can cause 500 errors when working with invalid content fields. This results in a fatal exception:
Argument 1 passed to eZ\Publish\Core\Repository\SiteAccessAware\ContentService::loadContentInfo() must be of the type int, string given, called in /app/vendor/ezsystems/ezplatform-content-forms/src/lib/Form/Type/FieldType/RelationListFieldType.php on line 83 [in vendor/ezsystems/ezplatform-kernel/eZ/Publish/Core/Repository/SiteAccessAware/ContentService.php:55]
I have noticed this with some third party field types, but it can be reproduced with the internal image field type as well, meaning that it is not third party code that causes the failure. Example video here: https://www.youtube.com/watch?v=MedWyVUUF1E
Steps to reproduce:
- Install clean install of eZ Platform v3.1.1
- Create a content type with
- Title
- RelationList
- Image (set size limit to 2MB)
- Create new object of field type
- Some title
- Any item selected in RelationList
- An image with size in excess of 1MB
- Publish object
- Edit content type
- Change max image size to 1MB
- Edit created content object
- NOTE: image contents are now invalid since larger than 1MB
- Publish
- Get exception (see attached image)
- Click back button and refresh
- To get back in draft edit
- Remove any related items
- Publish
- Get image field validation error (as expected)