sonata-project/SonataDoctrinePhpcrAdminBundle

Export broken

Closed this issue · 5 comments

I tried to use the export to export a list of stuff that is in my phpcr. I get this error:

Catchable fatal error:
Argument 3 passed to Sonata\\CoreBundle\\Exporter\\Exporter::getResponse()
must be an instance of Exporter\\Source\\SourceIteratorInterface,
null given,
called in {symfony root}/vendor/sonata-project/admin-bundle/Controller/CRUDController.php on line 747
and defined in {symfony root}/vendor/sonata-project/core-bundle/Exporter/Exporter.php on line 33
dbu commented

in the sandobx i don't see the export functionality. did you activate that manually? i fear this is simply not implemented and would need to be ported from the orm admin. or maybe it was once here but the core-bundle refactoring somehow broke it.

are you interested in investigating? we will be glad to help and give inputs, but don't have the resources to do this anytime soon.

Oh now I see. Found this in the code for phpcr admin bundle.

     /**
     * {@inheritDoc}
     *
     * @return null Not really implemented.
     */
    public function getDataSourceIterator(DatagridInterface $datagrid, array $fields, $firstResult = null, $maxResult = null)
    {
        return null;
    }

I am in the middle of something else right now so I am low on resources too. I think I know how to implement it and might give it a try. Maybe it could throw some kind of not implemented exception? I will close this issue for now.

dbu commented

okay. +1 for throwing an exception. -1 for the one you ended up with in your commit, rather have a \RuntimeException than of a random symfony component :-)

btw, where did you commit that? github tries to tell me its done in the official repository but i don't see any commits in there...

I found the notimplementedexception at tought it looked ok but it was in fact from some intl bundle. Didn't think that one trough. I removed the repository from my account so thats why github goes wonk.

dbu commented

ah, thats way. can you do a PR with a \RuntimeException please, moving
the comment into that exception? everything is better than the null.