Skip to content

Commit

Permalink
IBX-7492: Fixed error when editing image in user profile
Browse files Browse the repository at this point in the history
  • Loading branch information
adamwojs committed Jan 9, 2024
1 parent d54af6d commit cadd8c3
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 2 deletions.
9 changes: 8 additions & 1 deletion src/lib/Data/Content/ContentUpdateData.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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');
9 changes: 8 additions & 1 deletion src/lib/Data/User/UserUpdateData.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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');
16 changes: 16 additions & 0 deletions src/lib/Data/VersionInfoAwareInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php

/**
* @copyright Copyright (C) Ibexa AS. All rights reserved.
* @license For full copyright and license information view LICENSE file distributed with this source code.
*/
declare(strict_types=1);

namespace EzSystems\EzPlatformContentForms\Data;

use Ibexa\Core\Repository\Values\Content\VersionInfo;

interface VersionInfoAwareInterface
{
public function getVersionInfo(): VersionInfo;
}

0 comments on commit cadd8c3

Please sign in to comment.