symfony-cmf / media-bundle

UNMAINTAINED - Minimalistic interfaces to handle media in the context of the CMF
http://cmf.symfony.com/
30 stars 40 forks source link

check rename error (DocumentManager::move results in an error) #52

Closed lsmith77 closed 11 years ago

lsmith77 commented 11 years ago

followup for https://github.com/symfony-cmf/MediaBundle/pull/46

rmsint commented 11 years ago

Tested this a bit more and the issue is not related to Doctrine\ODM\PHPCR\DocumentManager::move but to the FM\ElFinderPHP\Driver\ElFinderVolumeDriver::rename.

In the last lines of the method it performs the Symfony\Cmf\Bundle\MediaBundle\Adapter\ElFinder\PhpcrDriver::_move and it expects back a string with the new path, we now return a boolean true. However the error is from theSymfony\Cmf\Bundle\MediaBundle\Adapter\ElFinder\PhpcrDriver::_stat being called afterwards. It tries to find for an unknown document, the document does not exist and then it tries to create a Directory for '/cms/media', the root, that already exists and thus throws an error. So this is related to issue https://github.com/symfony-cmf/MediaBundle/issues/53.

While solving this we should also check that moving a document still works afterwards.