From 55be856f63efff3880e03be752b4936f610ec8f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dawid=20Parafi=C5=84ski?= Date: Mon, 26 Mar 2018 17:04:46 +0200 Subject: [PATCH 1/2] EZP-28554: Error 400 after filling Text field in URL field type (#2278) --- eZ/Publish/Core/FieldType/Url/Type.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eZ/Publish/Core/FieldType/Url/Type.php b/eZ/Publish/Core/FieldType/Url/Type.php index 02ee18bdf0a..c70cf4fe9a5 100644 --- a/eZ/Publish/Core/FieldType/Url/Type.php +++ b/eZ/Publish/Core/FieldType/Url/Type.php @@ -82,7 +82,7 @@ protected function createValueFromInput($inputValue) */ protected function checkValueStructure(BaseValue $value) { - if (!is_string($value->link)) { + if (null !== $value->link && !is_string($value->link)) { throw new InvalidArgumentType( '$value->link', 'string', @@ -90,7 +90,7 @@ protected function checkValueStructure(BaseValue $value) ); } - if (isset($value->text) && !is_string($value->text)) { + if (null !== $value->text && !is_string($value->text)) { throw new InvalidArgumentType( '$value->text', 'string', From 060f9d825d281edfa020715e51405bd59aea427a Mon Sep 17 00:00:00 2001 From: Nattfarinn Date: Mon, 26 Mar 2018 19:33:22 +0200 Subject: [PATCH 2/2] EZP-28439: Related content is still displayed after it is moved to trash (#2287) --- .../Resources/config/fieldtype_services.yml | 14 ++++ .../Resources/views/content_fields.html.twig | 4 +- .../Repository/Values/Content/ContentInfo.php | 38 +++++++++ .../FieldType/Relation/ParameterProvider.php | 49 +++++++++++ .../RelationList/ParameterProvider.php | 55 ++++++++++++ .../Tests/Relation/ParameterProviderTest.php | 81 ++++++++++++++++++ .../RelationList/ParameterProviderTest.php | 84 +++++++++++++++++++ .../Location/Gateway/DoctrineDatabase.php | 2 +- .../Persistence/Legacy/Content/Mapper.php | 5 +- .../extract_content_from_rows_result.php | 1 + .../Core/Repository/Helper/DomainMapper.php | 16 ++++ .../SPI/Persistence/Content/ContentInfo.php | 16 +++- 12 files changed, 360 insertions(+), 5 deletions(-) create mode 100644 eZ/Publish/Core/MVC/Symfony/FieldType/Relation/ParameterProvider.php create mode 100644 eZ/Publish/Core/MVC/Symfony/FieldType/RelationList/ParameterProvider.php create mode 100644 eZ/Publish/Core/MVC/Symfony/FieldType/Tests/Relation/ParameterProviderTest.php create mode 100644 eZ/Publish/Core/MVC/Symfony/FieldType/Tests/RelationList/ParameterProviderTest.php diff --git a/eZ/Bundle/EzPublishCoreBundle/Resources/config/fieldtype_services.yml b/eZ/Bundle/EzPublishCoreBundle/Resources/config/fieldtype_services.yml index 4a28e769c46..9bd4a90923a 100644 --- a/eZ/Bundle/EzPublishCoreBundle/Resources/config/fieldtype_services.yml +++ b/eZ/Bundle/EzPublishCoreBundle/Resources/config/fieldtype_services.yml @@ -77,6 +77,20 @@ services: tags: - {name: ezpublish.fieldType.parameterProvider, alias: ezpage} + ezpublish.fieldType.ezobjectrelation.parameterProvider: + class: \eZ\Publish\Core\MVC\Symfony\FieldType\Relation\ParameterProvider + arguments: + - "@ezpublish.api.service.content" + tags: + - {name: ezpublish.fieldType.parameterProvider, alias: ezobjectrelation} + + ezpublish.fieldType.ezobjectrelationlist.parameterProvider: + class: \eZ\Publish\Core\MVC\Symfony\FieldType\RelationList\ParameterProvider + arguments: + - "@ezpublish.api.service.content" + tags: + - {name: ezpublish.fieldType.parameterProvider, alias: ezobjectrelationlist} + # Page ezpublish.fieldType.ezpage.pageService.factory: class: "%ezpublish.fieldType.ezpage.pageService.factory.class%" diff --git a/eZ/Bundle/EzPublishCoreBundle/Resources/views/content_fields.html.twig b/eZ/Bundle/EzPublishCoreBundle/Resources/views/content_fields.html.twig index 84a56e5492b..e82be4ebc64 100644 --- a/eZ/Bundle/EzPublishCoreBundle/Resources/views/content_fields.html.twig +++ b/eZ/Bundle/EzPublishCoreBundle/Resources/views/content_fields.html.twig @@ -264,7 +264,7 @@ {% spaceless %} {% if not ez_is_field_empty( content, field ) %}