Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JQueryAutocomplete works fine but relation won't be saved #69

Closed
morferic opened this issue Mar 16, 2012 · 2 comments
Closed

JQueryAutocomplete works fine but relation won't be saved #69

morferic opened this issue Mar 16, 2012 · 2 comments

Comments

@morferic
Copy link

Hi, thank you so much for this bundle.
In my localhost installation all works fine, both JQueryAutocompleter and data persist.
My classType is:

class ClientType extends AbstractType
{
    public function buildForm(FormBuilder $builder, array $options)
    {
           //I put only interesting field. Other ones works properly
           $builder->add('City', 'genemu_jqueryautocompleter', array(
                'route_name' => 'city_ajaxloader',
                'class'=>'MyBundle\Entity\City', 
                'widget' => 'entity',
                'property'=>'city_name',
                )); 
}

I have uploaded on an hosting server all the code I have in my local installation. All works fine, but when I persist my client entity, city entity don't be saved. In my local installation all goes right, but in my remote hosting not. source codes are the same.
I've tried to go to the SymfonyProfiler (both in local that in remote installation) and in "Request POST Parameters" I have noticed that the double quote of the "stringfied" json element is interpreted in different ways:

local:
MyBundle_clienttype %array% { name: 'John', last_name: Smith, ....., Cyty: '{"label":"CROTONE|KR","value":3236}' }

remote:
MyBundle_clienttype %array% { name: 'John', last_name: Smith, ....., City: '{"label":"ORLANDO|FL","value":3236}' }

In the Symfonyprofiler also I have noticed that Symfony does not made the query for retrieving city id in the remote installation:

//In local installation
SELECT t0.id AS id1 FROM City t0 WHERE t0.id = ?
Parameters: ['3236']

and consequently city id does not be saved in the client.city_id column.
Seems that Sympony2 does not see that i've changed the city field.

I'm not sure that is a AjaxAutoloader problem (I'm sure), but I can't find any solution for this.
Do you have any suggestion?
Many thanks!

@sterrien
Copy link

I think that in your remote hosting you have magic_quotes_gpc set to on in php configuration. Can you check this ?

@morferic
Copy link
Author

Thank you so much for the suggestion!
This have solved my problem!
For anyone who have the same problem (on a Godaddy host):

  1. I have added in the php.ini file this three line to disable magic_quotes_gpc:

magic_quotes_gpc = Off
magic_quotes_runtime = Off
magic_quotes_sybase = Off

  1. This should be enough, but nothing happens then...
  2. I have duplicated this file and renamed it in php5.ini (i.e now I have two files php.ini and php5.ini, both supported in Godaddy linux hosting)
  3. I have reset web services from my Hosting Panel on my goDaddy account;

on every change check the phpinfo file to verify if all go right.
Thank you so much sterrien!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants