mirror of
https://github.com/getgrav/grav.git
synced 2026-07-09 07:33:28 +02:00
Add media support for Flex GenericObject
This commit is contained in:
@@ -14,6 +14,7 @@ namespace Grav\Common\Flex\Types\Generic;
|
||||
use Grav\Common\Flex\Traits\FlexGravTrait;
|
||||
use Grav\Common\Flex\Traits\FlexObjectTrait;
|
||||
use Grav\Framework\Flex\FlexObject;
|
||||
use Grav\Framework\Flex\Traits\FlexMediaTrait;
|
||||
|
||||
/**
|
||||
* Class GenericObject
|
||||
@@ -23,4 +24,5 @@ class GenericObject extends FlexObject
|
||||
{
|
||||
use FlexGravTrait;
|
||||
use FlexObjectTrait;
|
||||
use FlexMediaTrait;
|
||||
}
|
||||
|
||||
@@ -734,7 +734,7 @@ class UserObject extends FlexObject implements UserInterface, MediaManipulationI
|
||||
|
||||
protected function saveUpdatedMedia(): void
|
||||
{
|
||||
$media = $this->getFlexMedia();
|
||||
$media = $this->getMedia();
|
||||
if (!$media instanceof MediaUploadInterface) {
|
||||
throw new \RuntimeException('Internal error UO101');
|
||||
}
|
||||
|
||||
@@ -192,7 +192,7 @@ trait FlexMediaTrait
|
||||
*/
|
||||
protected function saveUpdatedMedia(): void
|
||||
{
|
||||
$media = $this->getExistingMedia();
|
||||
$media = $this->getMedia();
|
||||
|
||||
// Upload/delete altered files.
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user