redbaron76 / PongoCMS-Laravel-cms-bundle

a CMS bundle for Laravel 3.2 and Twitter Bootstrap 2.2.0
http://pongocms.com
Other
100 stars 32 forks source link

Selecting gallery images not working #6

Closed Edwin-Luijten closed 11 years ago

Edwin-Luijten commented 11 years ago

When selecting the checkboxes and hitting save or save and exit, POST http://staging.le-feu.nl/cms/ajax_gallery/save_gallery throws:

Unhandled Exception Message:

Array to string conversion

Location:

D:\www_Frameworks\Laravel-3.2.10\laravel\input.php on line 43

redbaron76 commented 11 years ago

The default website behaves in the same way? In my local machine it works correctly...

Edwin-Luijten commented 11 years ago

I checked it on my local machine, it works correctly. These are the post values: back_url # file_id[] 25 gallery_id 2 gallery_name catalog gallery_thumb catalog

Edwin-Luijten commented 11 years ago

Update, I re-installed pongo-cms and still get the above error. Further information about my environment: Wampserver: PHP 5.4.3, Apache 2.4.2, Mysql 5.5.24 Laravel: 3.2.10

redbaron76 commented 11 years ago

Are you able to trace POST data?

Edwin-Luijten commented 11 years ago

Yup, firebug show this as post data: back_url # file_id[] 25 gallery_id 2 gallery_name catalog gallery_thumb catalog

redbaron76 commented 11 years ago

Laravel's Input::has tries to make a casting conversion from array (file_id[]) to string in order to check if it exists. Maybe in Php 5.4 this is not allowed... but I'm not able to check with that version of Php right now. Just to make a test, change row 57 of /bundles/cms/controllers/ajax_gallery.php:

from: if(Input::has('file_id')) {

to: if(Input::get('file_id') !== '') {

It's basically the same check Input::has() does but without casting. And let me know if the error still rises.

Edwin-Luijten commented 11 years ago

This fixed the issue =]

redbaron76 commented 11 years ago

Good to know. I'll schedule it for my next commit. Tnx