sonata-project / SonataMediaBundle

Symfony SonataMediaBundle
https://docs.sonata-project.org/projects/SonataMediaBundle
MIT License
451 stars 495 forks source link

Problem with the new tabsystem in 2.4 #634

Closed lucasgranberg closed 9 years ago

lucasgranberg commented 10 years ago

I have Sonata Admin and Media set to "2.4.*@dev" and I get this error. I tried looking up the problem and I noticed that the request is empty in the SonataAdminBundle:CrudController.


Impossible to access a key ("default") on a boolean variable ("") in
SonataAdminBundle:CRUD:base_edit_form.html.twig at line 56

The error comes from this file becouse the admin.formtabs variable is set to false.

Thommas commented 9 years ago

Same problem here.

Basically just setup an Entity with a boolean inside.

Add this : $formMapper ->add('is_something', null, $options) ; Triggers the error when editing the object.

SF2.6 + SonataAdminBundle "~2.3".

Quick fix will be to override the Sonata template for now to get rid of this problem.

Thommas commented 9 years ago

OK I just realized Sonata won't work with SF2.6 but SF2.3 ... I needed SF2.5 min for HWI using PropertyAccess component. So I will need to find a solution.

sskorc commented 9 years ago

I had the same issue when trying to integrate SonataMediaBundle with SonataAdminBundle. The problem occurred when trying to add new media element from admin panel and the reason for this was that no provider parameter was passed in the URL. I did these two things to get rid of this problem:

services:
    acme.admin.media:
        class: Acme\MediaBundle\Admin\MediaAdmin
        tags:
            - { name: sonata.admin, manager_type: doctrine_mongodb, group: "Content", label: "Media" }
        arguments:
            - ~
            - Acme\MediaBundle\Document\Media
            - '%sonata.media.admin.media.controller%'
            - @sonata.media.pool

FYI I'm using Sonata ver. 2.3 and Symfony ver. 2.6

rande commented 9 years ago

@Thommas Sonata's bundles work with symfony 2.5. Seems there are issues with serialization of validation with Symfony 2.6

skobkin commented 9 years ago

Same problem.

Just installed MediaBundle. Trying to add files to my entity: Entity:

    /**
     * @var Media
     *
     *
     * @ORM\ManyToOne(targetEntity="Application\Sonata\MediaBundle\Entity\Media", cascade={"all"}, fetch="EXTRA_LAZY")
     * @ORM\JoinColumn(name="media_id")
     */
    private $file;

Admin:

    protected function configureFormFields(FormMapper $formMapper)
    {
        $formMapper
            // ...
            ->add('file', 'sonata_type_model_list', [], [
                'link_parameters' => [
                    'context' => 'client_build',
                    'provider' => 'sonata.media.provider.file',
                ]
            ])
            // ...
        ;
    }

When I trying to add new file in the admin dashboard, I get this error.

PHP 5.6.8-pl0-gentoo
"symfony/symfony": "2.6.*", [2.6.6]
"sonata-project/core-bundle": "dev-master",
"sonata-project/intl-bundle": "~2.2", [2.2.1]
"sonata-project/admin-bundle": "dev-master",
"sonata-project/doctrine-orm-admin-bundle": "dev-master",
"sonata-project/easy-extends-bundle": "dev-master",
"sonata-project/user-bundle": "dev-master",
"sonata-project/datagrid-bundle": "dev-master",
"sonata-project/classification-bundle": "dev-master",
"sonata-project/media-bundle": "dev-master",
webdevilopers commented 9 years ago

Any news on this? I still seem to have this problem with current dev-masters.

While uploading images using the Sonata Admin class works fine the sonata_type_model_list field type fails.

webdevilopers commented 9 years ago

Correcting myself. The error message only appeared when opening the AJAX url in a new tab. When looking at the console and the HTML Response it was a permission problem with mkdir.

So far everything seems to work fine!

lucasgranberg commented 9 years ago

Ill close this issue as I don't think its an issue anymore and I can't check it out right now.

OskarStark commented 9 years ago

:+1: