Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IBX-7492: Fixed error when editing image in user profile #60

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion src/lib/Data/Content/ContentUpdateData.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,15 @@
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;

/**
* @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 @@ -10,13 +10,15 @@

use Ibexa\ContentForms\Data\Content\ContentData;
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;

/**
* @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 Ibexa\ContentForms\Data;

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

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