SQL error creating client in 2.8

Hi all.

Trying the new versio dolibarr 2.8 when I create a client or supplier it gives me a SQL error:

Error sql=UPDATE llx_societe SET nom = ‘Prueba’,datea = 20100325003121,address = ‘’,cp = null,ville = null,fk_departement = ‘0’,fk_pays = ‘4’,tel = null,fax = null,email = null,url = null,siren = ‘’,siret = ‘’,ape = ‘’,idprof4 = ‘’,tva_assuj = ‘1’,tva_intra = ‘’,localtax1_assuj = ‘’,localtax2_assuj = ‘’,capital = ‘0’,prefix_comm = null,fk_effectif = null,fk_typent = 0,fk_forme_juridique = null,client = 1,fournisseur = 0,gencod = null, code_client = null, code_compta = null, code_fournisseur = null, code_compta_fournisseur = null, fk_user_modif = ‘1’ WHERE rowid = ‘13’

I checked that the table llx_societe is empty in the database. I suppose that dolibarr couldn’t creat the record in llx_societe and after that the update fails but I don’t know why. Any idea?

Apache 2.2.15
PHP 5.3.2
MySql 5.1.45

Thanks in advance.

Iago.

Don’t you have a mysql error code ? Only the Error sql… message given here ?
What about if you execute the request from a SQL tools directly ?

Hi eldy.

Thanks for your response. I don’t have a mysql error code.

I’ve searched the bugs french forum and found this post with somebody with the same error: http://www.dolibarr.fr/forum/5-bugs/20232-28-stable-nouveau-client--impossible-

He found out a possible mistake in the code. He modifies the file societe.class.php in htdocs. The lines 432 and 433:

From:

			$sql .= ",localtax1_assuj = ".($this->localtax1_assuj>=0?"'".$this->localtax1_assuj."'":"null");
			$sql .= ",localtax2_assuj = ".($this->localtax2_assuj>=0?"'".$this->localtax2_assuj."'":"null");

To:

			$sql .= ",localtax1_assuj = ".($this->localtax1_assuj>0?"'".$this->localtax1_assuj."'":"null");
			$sql .= ",localtax2_assuj = ".($this->localtax2_assuj>0?"'".$this->localtax2_assuj."'":"null");

Modifying this code it also works for me. It’s strange for me that only two people are complaining about this. Does it depend in the country code? I found some code in soc.php that references code==‘ES’ and prints then the local taxes fields. I’m from Spain.

Thanks Eldy.

Iago.

Also eldy some question.

The other user (benharvest) found out the solution in mode debug. How could I enter in mode debug?

Iago.

To switch in debug mode, you must activate the syslog module.

I can not reproduce it in any form, serves me right, with and without MAIN_FEATURES_LEVEL…

I will investigate tonight!!

My problem for reproduce it was that I don’t had the strict option of Mysql.

Eldy has solved the code problem very quickly…

Hi all.

I’ve tried the eldy modification in code and also works for me.

Thanks to all.

Iago