Skip to content

Commit

Permalink
import image fixed in editorjs
Browse files Browse the repository at this point in the history
  • Loading branch information
RobinDev committed Feb 20, 2021
1 parent 71506c6 commit 5bb0851
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/admin-block-editor-tools/dist/PagesList.js

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public function __construct(EntityManagerInterface $em)

public function manage(Request $request, ImageManager $imageManager): Response
{
/** @param File $mediaFile */
/** @var File $mediaFile */
$mediaFile = $request->getContent() ? $this->getMediaFrom($request->getContent())
: $request->files->get('image');

Expand All @@ -41,14 +41,14 @@ public function manage(Request $request, ImageManager $imageManager): Response
$media = $mediaFile;
} else {
$mediaClass = $this->mediaClass;
/** @param MediaInterface $media */
/** @var MediaInterface $media */
$media = new $mediaClass();
$media->setMediaFile($mediaFile);
$this->em->persist($media);
$this->em->flush();
}

$url = false === strpos($mediaFile->getMimeType(), 'image/') ? '/download/'.$media->getMedia()
$url = false === strpos($media->getMimeType(), 'image/') ? '/download/'.$media->getMedia()
: $imageManager->getBrowserPath($media->getMedia());

return new Response(json_encode([
Expand Down
Binary file modified packages/skeleton/var/app.db
Binary file not shown.

0 comments on commit 5bb0851

Please sign in to comment.