symfony-cmf / cmf-sandbox

Base project for trying CMF components integration
http://cmf.symfony.com
Other
366 stars 140 forks source link

image upload doesn't work #77

Closed stbucher closed 11 years ago

stbucher commented 12 years ago

after upload it appears a brocken image

dbu commented 12 years ago

@colinfrei @rryter: can one of you have a look at the current sandbox and see if you figure out why the "Upload" button opens in a new window and why upload is broken? i tried checking out a sandbox from march and got it working, but the problem remains... stbucher has to demo the stuff wednesday, would be great if you could have a look.

colinfrei commented 12 years ago

We didn't handle image uploading at all, all we had was an empty tab for uploading.

That aside, I can't get the current sandbox running (in vagrant):

Fatal error: Declaration of Doctrine\ODM\PHPCR\Mapping\ClassMetadataFactory::doLoadMetadata() must be compatible with that of Doctrine\Common\Persistence\Mapping\AbstractClassMetadataFactory::doLoadMetadata() in /Users/colinfrei/Sites/cmf/vendor/doctrine/phpcr-odm/lib/Doctrine/ODM/PHPCR/Mapping/ClassMetadataFactory.php on line 42

lsmith77 commented 11 years ago

fixed

casoetan commented 11 years ago

Hello I'm playing with the cmf-sandbox but can't seem to upload images with the create and was wondering can I configure (and how to) the admin backend to use tinymce or some rich text input? thanks

lsmith77 commented 11 years ago

@casoetan can use something like firebug to check the response of the upload request or alternatively check in the profiler?

as for using tinycme. i am not sure about the best approach here. best would be to ask @rande, the author of SonataAdminBundle.

casoetan commented 11 years ago

Thanks, here is what my console comes up with

exception 'Symfony\Component\HttpKernel\Exception\NotFoundHttpException' with message 'Image 'upload' not found at '/cms/content/static/upload'' in C:\Data\Zend\Apache2\htdocs\cas5\cmf-s\vendor\symfony-cmf\create-bundle\Symfony\Cmf\Bundle\CreateBundle\Controller\ImageController.php:115 Stack trace:

0 [internal function]: Symfony\Cmf\Bundle\CreateBundle\Controller\ImageController->displayAction('upload')

1 C:\Data\Zend\Apache2\htdocs\cas5\cmf-s\app\bootstrap.php.cache(1426): call_user_func_array(Array, Array)

2 C:\Data\Zend\Apache2\htdocs\cas5\cmf-s\app\bootstrap.php.cache(1390): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1)

3 C:\Data\Zend\Apache2\htdocs\cas5\cmf-s\app\bootstrap.php.cache(1566): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)

4 C:\Data\Zend\Apache2\htdocs\cas5\cmf-s\app\bootstrap.php.cache(617): Symfony\Bundle\FrameworkBundle\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)

5 C:\Data\Zend\Apache2\htdocs\cas5\cmf-s\web\app_dev.php(29): Symfony\Component\HttpKernel\Kernel->handle(Object(Symfony\Component\HttpFoundation\Request))

6 {main}

lsmith77 commented 11 years ago

this error indicates another error just before. specifically it means that the redirect after the upload isnt finding the image that was stored, which would mean there is some error inside PHPCRImageController. i am traveling currently .. but maybe you can try and debug. if the image could not be stored at all, then the flush() should have thrown an exception. you can check if something was stored with the app/console doctrine:fixture:dump command .. the image would be stored by default into /cms/content/static with a random node name. so i suspect something is going wrong with computing the the id inside the displayAction() method.

casoetan commented 11 years ago

Oh! I hope I wasn't too much of a bother. I Just checked and nothing is stored, cms/content/static is empty, but I'll check to see what I can do pls do enjoy your trip, hope you can help when relaxed.

lsmith77 commented 11 years ago

no worries. then check what is going on inside uploadAction()

casoetan commented 11 years ago

Really don't know what to do with the upload method, it all seems good but for some reason its failing

POST http://localhost/cas5/cmf-s/web/app_dev.php/symfony-cmf/create/image/upload 500 (Internal Server Error)

lsmith77 commented 11 years ago

there should be more information in the profiler

casoetan commented 11 years ago

Plain tired, worked through the profiler and still same. maybe its a windows or my setup. Will check through in the morning. Its 12.21 am here. Thanks for all

lsmith77 commented 11 years ago

it can very well be windows since none of the core devs use windows. so we are quite depend end on people like you to test things out

casoetan commented 11 years ago

I guess so, what can I do to help the team. I'll upload to my server to really make sure it's windows.

Sent from my iPhone

On 2 Jan 2013, at 09:45, Lukas Kahwe Smith notifications@github.com wrote:

it can very well be windows since none of the core devs use windows. so we are quite depend end on people like you to test things out

— Reply to this email directly or view it on GitHubhttps://github.com/symfony-cmf/cmf-sandbox/issues/77#issuecomment-11802235.

casoetan commented 11 years ago

Fixed it. The issue was with includejsfiles-create.html.twig, it was set to false for cmfCreateHalloImageUpload, but once I changed that true, uploads worked. Thanks for the help and I apologise for taking this long to check it out

lsmith77 commented 11 years ago

cmfCreateImageUploadEnabled is set to a boolean value inside JsloaderController, which in turn determines the value based on the imageClass .. is there a bug somewhere in there? if not i guess it needs to be properly documented.