page evenement
This commit is contained in:
Regular → Executable
+3
-2
@@ -120,7 +120,7 @@ trait FlexMediaTrait
|
||||
// Load settings for the field.
|
||||
$schema = $this->getBlueprint()->schema();
|
||||
$settings = $field && is_object($schema) ? (array)$schema->getProperty($field) : null;
|
||||
if (!isset($settings) || !is_array($settings)) {
|
||||
if (!is_array($settings)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -373,7 +373,7 @@ trait FlexMediaTrait
|
||||
if (is_array($upload)) {
|
||||
// Uses new format with [UploadedFileInterface, array].
|
||||
$settings = $upload[1];
|
||||
if ($settings['destination'] === $media->getPath()) {
|
||||
if (isset($settings['destination']) && $settings['destination'] === $media->getPath()) {
|
||||
$upload = $upload[0];
|
||||
} else {
|
||||
$upload = false;
|
||||
@@ -383,6 +383,7 @@ trait FlexMediaTrait
|
||||
$medium = $upload ? MediumFactory::fromUploadedFile($upload) : null;
|
||||
$updated = true;
|
||||
if ($medium) {
|
||||
$medium->uploaded = true;
|
||||
$media->add($filename, $medium);
|
||||
} elseif (is_callable([$media, 'hide'])) {
|
||||
$media->hide($filename);
|
||||
|
||||
Reference in New Issue
Block a user