Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
kohinos
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
9
Issues
9
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
cooperatic-mlc
kohinos
Commits
2a5984da
Commit
2a5984da
authored
Feb 08, 2019
by
Julien Jorry
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix BO admin media bug :
https://github.com/sonata-project/SonataAdminBundle/issues/5433
parent
2b94e417
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
0 deletions
+32
-0
services.yaml
config/services.yaml
+8
-0
MediaAdmin.php
src/Admin/MediaAdmin.php
+24
-0
No files found.
config/services.yaml
View file @
2a5984da
...
@@ -6,6 +6,7 @@
...
@@ -6,6 +6,7 @@
parameters
:
parameters
:
locale
:
'
en'
locale
:
'
en'
sonata.user.admin.user.controller
:
'
App\Controller\CRUD\CRUDController'
sonata.user.admin.user.controller
:
'
App\Controller\CRUD\CRUDController'
sonata.media.admin.media.class
:
'
App\Admin\MediaAdmin'
services
:
services
:
# default configuration for services in *this* file
# default configuration for services in *this* file
...
@@ -212,3 +213,9 @@ services:
...
@@ -212,3 +213,9 @@ services:
# group: "Comptabilité"
# group: "Comptabilité"
# label: "Flux"
# label: "Flux"
# public: true
# public: true
# app.flash_messenger:
# class: App\Listener\Flash
# arguments: ["@session"]
# tags:
# - { name: kernel.event_listener, event: kernel.response }
\ No newline at end of file
src/Admin/MediaAdmin.php
0 → 100644
View file @
2a5984da
<?php
namespace
App\Admin
;
use
Sonata\AdminBundle\Object\Metadata
;
use
Sonata\MediaBundle\Admin\ORM\MediaAdmin
as
BaseMediaAdmin
;
use
Sonata\MediaBundle\Provider\MediaProviderInterface
;
class
MediaAdmin
extends
BaseMediaAdmin
{
/**
* {@inheritdoc}
*/
public
function
getObjectMetadata
(
$object
)
{
$provider
=
$this
->
pool
->
getProvider
(
$object
->
getProviderName
());
$url
=
$provider
->
generatePublicUrl
(
$object
,
$provider
->
getFormatName
(
$object
,
MediaProviderInterface
::
FORMAT_ADMIN
)
);
return
new
Metadata
(
$object
->
getName
(),
$object
->
getDescription
(),
$url
);
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment