From 09b66a27bd5fc1badc45b9be9c69f11cc70816d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adam=20W=C3=B3js?= Date: Tue, 9 Jan 2024 21:09:58 +0100 Subject: [PATCH 1/5] IBX-7492: Fixed error when editing image in user profile --- src/lib/Data/Content/ContentUpdateData.php | 9 ++++++++- src/lib/Data/User/UserUpdateData.php | 9 ++++++++- src/lib/Data/VersionInfoAwareInterface.php | 16 ++++++++++++++++ 3 files changed, 32 insertions(+), 2 deletions(-) create mode 100644 src/lib/Data/VersionInfoAwareInterface.php diff --git a/src/lib/Data/Content/ContentUpdateData.php b/src/lib/Data/Content/ContentUpdateData.php index 86fa84b0..146f9fef 100644 --- a/src/lib/Data/Content/ContentUpdateData.php +++ b/src/lib/Data/Content/ContentUpdateData.php @@ -8,14 +8,16 @@ namespace Ibexa\ContentForms\Data\Content; +use EzSystems\EzPlatformContentForms\Data\VersionInfoAwareInterface; use Ibexa\ContentForms\Data\NewnessCheckable; use Ibexa\Core\Repository\Values\Content\ContentUpdateStruct; +use Ibexa\Core\Repository\Values\Content\VersionInfo; /** * @property \Ibexa\Contracts\ContentForms\Data\Content\FieldData[] $fieldsData * @property \Ibexa\Contracts\Core\Repository\Values\Content\Content $contentDraft */ -class ContentUpdateData extends ContentUpdateStruct implements NewnessCheckable +class ContentUpdateData extends ContentUpdateStruct implements NewnessCheckable, VersionInfoAwareInterface { use ContentData; @@ -25,6 +27,11 @@ public function isNew() { return false; } + + public function getVersionInfo(): VersionInfo + { + return $this->contentDraft->versionInfo; + } } class_alias(ContentUpdateData::class, 'EzSystems\EzPlatformContentForms\Data\Content\ContentUpdateData'); diff --git a/src/lib/Data/User/UserUpdateData.php b/src/lib/Data/User/UserUpdateData.php index d7b3f63d..c973ca2f 100644 --- a/src/lib/Data/User/UserUpdateData.php +++ b/src/lib/Data/User/UserUpdateData.php @@ -8,15 +8,17 @@ namespace Ibexa\ContentForms\Data\User; +use EzSystems\EzPlatformContentForms\Data\VersionInfoAwareInterface; use Ibexa\ContentForms\Data\Content\ContentData; use Ibexa\ContentForms\Data\NewnessCheckable; use Ibexa\Contracts\Core\Repository\Values\User\UserUpdateStruct; +use Ibexa\Core\Repository\Values\Content\VersionInfo; /** * @property \Ibexa\Contracts\ContentForms\Data\Content\FieldData[] $fieldsData * @property \Ibexa\Contracts\Core\Repository\Values\User\User $user */ -class UserUpdateData extends UserUpdateStruct implements NewnessCheckable +class UserUpdateData extends UserUpdateStruct implements NewnessCheckable, VersionInfoAwareInterface { use ContentData; @@ -34,6 +36,11 @@ public function isNew() { return false; } + + public function getVersionInfo(): VersionInfo + { + return $this->user->versionInfo; + } } class_alias(UserUpdateData::class, 'EzSystems\EzPlatformContentForms\Data\User\UserUpdateData'); diff --git a/src/lib/Data/VersionInfoAwareInterface.php b/src/lib/Data/VersionInfoAwareInterface.php new file mode 100644 index 00000000..07ce4741 --- /dev/null +++ b/src/lib/Data/VersionInfoAwareInterface.php @@ -0,0 +1,16 @@ + Date: Wed, 10 Jan 2024 09:43:19 +0100 Subject: [PATCH 2/5] fixup! IBX-7492: Fixed error when editing image in user profile --- src/lib/Data/Content/ContentUpdateData.php | 1 - src/lib/Data/User/UserUpdateData.php | 2 +- src/lib/Data/VersionInfoAwareInterface.php | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/lib/Data/Content/ContentUpdateData.php b/src/lib/Data/Content/ContentUpdateData.php index 146f9fef..f301b71a 100644 --- a/src/lib/Data/Content/ContentUpdateData.php +++ b/src/lib/Data/Content/ContentUpdateData.php @@ -8,7 +8,6 @@ namespace Ibexa\ContentForms\Data\Content; -use EzSystems\EzPlatformContentForms\Data\VersionInfoAwareInterface; use Ibexa\ContentForms\Data\NewnessCheckable; use Ibexa\Core\Repository\Values\Content\ContentUpdateStruct; use Ibexa\Core\Repository\Values\Content\VersionInfo; diff --git a/src/lib/Data/User/UserUpdateData.php b/src/lib/Data/User/UserUpdateData.php index c973ca2f..ce8b74c1 100644 --- a/src/lib/Data/User/UserUpdateData.php +++ b/src/lib/Data/User/UserUpdateData.php @@ -8,8 +8,8 @@ namespace Ibexa\ContentForms\Data\User; -use EzSystems\EzPlatformContentForms\Data\VersionInfoAwareInterface; use Ibexa\ContentForms\Data\Content\ContentData; +use Ibexa\ContentForms\Data\Content\VersionInfoAwareInterface; use Ibexa\ContentForms\Data\NewnessCheckable; use Ibexa\Contracts\Core\Repository\Values\User\UserUpdateStruct; use Ibexa\Core\Repository\Values\Content\VersionInfo; diff --git a/src/lib/Data/VersionInfoAwareInterface.php b/src/lib/Data/VersionInfoAwareInterface.php index 07ce4741..4a209fe3 100644 --- a/src/lib/Data/VersionInfoAwareInterface.php +++ b/src/lib/Data/VersionInfoAwareInterface.php @@ -6,7 +6,7 @@ */ declare(strict_types=1); -namespace EzSystems\EzPlatformContentForms\Data; +namespace Ibexa\ContentForms\Data\Content; use Ibexa\Core\Repository\Values\Content\VersionInfo; From 3e07dec0cab4d6f58ae2498978e641776cbec43c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adam=20W=C3=B3js?= Date: Wed, 10 Jan 2024 15:05:11 +0100 Subject: [PATCH 3/5] fixup! IBX-7492: Fixed error when editing image in user profile --- src/lib/Data/User/UserUpdateData.php | 2 +- src/lib/Data/VersionInfoAwareInterface.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/Data/User/UserUpdateData.php b/src/lib/Data/User/UserUpdateData.php index ce8b74c1..da8f3557 100644 --- a/src/lib/Data/User/UserUpdateData.php +++ b/src/lib/Data/User/UserUpdateData.php @@ -9,7 +9,7 @@ namespace Ibexa\ContentForms\Data\User; use Ibexa\ContentForms\Data\Content\ContentData; -use Ibexa\ContentForms\Data\Content\VersionInfoAwareInterface; +use Ibexa\ContentForms\Data\VersionInfoAwareInterface; use Ibexa\ContentForms\Data\NewnessCheckable; use Ibexa\Contracts\Core\Repository\Values\User\UserUpdateStruct; use Ibexa\Core\Repository\Values\Content\VersionInfo; diff --git a/src/lib/Data/VersionInfoAwareInterface.php b/src/lib/Data/VersionInfoAwareInterface.php index 4a209fe3..aefb274a 100644 --- a/src/lib/Data/VersionInfoAwareInterface.php +++ b/src/lib/Data/VersionInfoAwareInterface.php @@ -6,7 +6,7 @@ */ declare(strict_types=1); -namespace Ibexa\ContentForms\Data\Content; +namespace Ibexa\ContentForms\Data; use Ibexa\Core\Repository\Values\Content\VersionInfo; From f18e0aae6f0266ffff0dc54deb0ce78929033e98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adam=20W=C3=B3js?= Date: Wed, 10 Jan 2024 15:07:52 +0100 Subject: [PATCH 4/5] fixup! IBX-7492: Fixed error when editing image in user profile --- src/lib/Data/User/UserUpdateData.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/Data/User/UserUpdateData.php b/src/lib/Data/User/UserUpdateData.php index da8f3557..5a9bd05e 100644 --- a/src/lib/Data/User/UserUpdateData.php +++ b/src/lib/Data/User/UserUpdateData.php @@ -9,8 +9,8 @@ namespace Ibexa\ContentForms\Data\User; use Ibexa\ContentForms\Data\Content\ContentData; -use Ibexa\ContentForms\Data\VersionInfoAwareInterface; use Ibexa\ContentForms\Data\NewnessCheckable; +use Ibexa\ContentForms\Data\VersionInfoAwareInterface; use Ibexa\Contracts\Core\Repository\Values\User\UserUpdateStruct; use Ibexa\Core\Repository\Values\Content\VersionInfo; From 167e893fb42c731a7fbd77d72c3b7ae5d3016af9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adam=20W=C3=B3js?= Date: Wed, 10 Jan 2024 15:11:03 +0100 Subject: [PATCH 5/5] fixup! IBX-7492: Fixed error when editing image in user profile --- src/lib/Data/Content/ContentUpdateData.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lib/Data/Content/ContentUpdateData.php b/src/lib/Data/Content/ContentUpdateData.php index f301b71a..548db3da 100644 --- a/src/lib/Data/Content/ContentUpdateData.php +++ b/src/lib/Data/Content/ContentUpdateData.php @@ -9,6 +9,7 @@ namespace Ibexa\ContentForms\Data\Content; use Ibexa\ContentForms\Data\NewnessCheckable; +use Ibexa\ContentForms\Data\VersionInfoAwareInterface; use Ibexa\Core\Repository\Values\Content\ContentUpdateStruct; use Ibexa\Core\Repository\Values\Content\VersionInfo;