Contact editing not working

I hereby make a separate subject for this topic.

Using V 7.1.1
Edtiting contacts is not working. Any contact that I try to edit and save give this error:
Database failure. Please refer to sugarcrm.log for details.

Here is the logfile:
Databaselog:
Thu Apr 10 10:24:29 2014 [15691][1][FATAL] Error updating table: contacts: Query Failed: UPDATE contacts
SET date_modified=‘2014-04-10 08:24:29’,modified_user_id=‘1’,created_by=‘1’,description=NULL,assigned_user_id=‘1’,salutation=NULL,first_name=‘testkontakt’,last_name=‘test’,title=‘tittelen’,department=NULL,do_not_call=0,phone_home=NULL,phone_mobile=NULL,phone_work=‘61184140’,phone_other=NULL,phone_fax=NULL,primary_address_street=‘Studievegen 16’,primary_address_city=‘Gjøvik’,primary_address_state=NULL,primary_address_postalcode=‘2815’,primary_address_country=NULL,alt_address_street=NULL,alt_address_city=NULL,alt_address_state=NULL,alt_address_postalcode=NULL,alt_address_country=NULL,assistant=NULL,assistant_phone=NULL,lead_source=NULL,reports_to_id=’’,birthdate=NULL,campaign_id=’’,=NULL,joomla_account_id=NULL,portal_account_disabled=0,portal_user_type=‘Single’
WHERE contacts.id = ‘4e61cd9f-bc1f-1fee-19ba-53457648a997’ AND deleted=0: MySQL error 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘=NULL,joomla_account_id=NULL,portal_account_disabled=0,portal_user_type=‘Single’’ at line 2
Second error:
Thu Apr 10 00:31:46 2014 [31032][45ef7f72-f4d8-e84c-0ee7-533de47e4ccf][FATAL] Error running count query for Contact List: Query Failed: ( SELECT count(*) c FROM fp_events INNER JOIN fp_events_contacts_c ON fp_events.id=fp_events_contacts_c.fp_events_contactsfp_events_ida AND fp_events_contacts_c.fp_events_contactscontacts_idb=‘6d0adc22-5b8f-59a2-a2ae-53456299f137’ AND fp_events_contacts_c.deleted=0

where fp_events.deleted=0 ): MySQL error 1146: Table ‘suitecrmdb.fp_events_contacts_c’ doesn’t exist
Thu Apr 10 10:23:28 2014 [9563][1][FATAL] Error running count query for Contact List: Query Failed: ( SELECT count(*) c FROM fp_events INNER JOIN fp_events_contacts_c ON fp_events.id=fp_events_contacts_c.fp_events_contactsfp_events_ida AND fp_events_contacts_c.fp_events_contactscontacts_idb=‘4e61cd9f-bc1f-1fee-19ba-53457648a997’ AND fp_events_contacts_c.deleted=0

where fp_events.deleted=0 ): MySQL error 1146: Table ‘suitecrmdb.fp_events_contacts_c’ doesn’t exist

Hi Egil,

Can you do a quick repair and rebuild (This can be found in the admin page)? It looks like, for whatever reason, one of the relationship tables is missing.

Thanks,
Jim

1 Like

Thank, but no luck with this. We still get the same error message and the log say following:
Mon Apr 14 14:40:49 2014 [16716][1][FATAL] Error updating table: contacts: Query Failed: UPDATE contacts
SET date_modified=‘2014-04-14 12:40:49’,modified_user_id=‘1’,created_by=‘1’,description=NULL,assigned_user_id=‘1’,salutation=NULL,first_name=NULL,last_name=‘Harald Bakke’,title=‘dl’,department=NULL,do_not_call=0,phone_home=NULL,phone_mobile=NULL,phone_work=‘61184140’,phone_other=NULL,phone_fax=NULL,primary_address_street=‘Studievegen 16’,primary_address_city=‘Gjøvik’,primary_address_state=NULL,primary_address_postalcode=‘2815’,primary_address_country=NULL,alt_address_street=NULL,alt_address_city=NULL,alt_address_state=NULL,alt_address_postalcode=NULL,alt_address_country=NULL,assistant=NULL,assistant_phone=NULL,lead_source=NULL,reports_to_id=’’,birthdate=NULL,campaign_id=’’,=NULL,joomla_account_id=NULL,portal_account_disabled=0,portal_user_type=‘Single’
WHERE contacts.id = ‘19004f63-b1a9-3b1a-6dcf-53456aa07df8’ AND deleted=0: MySQL error 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘=NULL,joomla_account_id=NULL,portal_account_disabled=0,portal_user_type=‘Single’’ at line 2

Hi Egil,

It looks like some vardefs may be incorrect (some may be missing a name which would cause empty names in the SQL query). If you look in

cache/modules/Contacts/Contactvardefs.php

are there any vardefs which are very short. Alternatively you could attach this file and I can have a look.

Thanks,
Jim

Hi

Attached is the file you asked for.

Hi

Attached is the file you requested.

Hi Jim, I tried attaching the file, and as the forum was not too fond of .php files I renamed it to .txt.
However, the post has not showed up yet.
Would it be possible to mail it to you?

Thanks,
Andreas

Hi,

In the supplied file there is a custom field called facebook_username_c entry that is incomplete:


'facebook_username_c' => 
    array (
      'labelValue' => 'Facebook Username',
    ),

this is causing the malformed SQL.

If you comment out the line:

$dictionary['Contact']['fields']['facebook_username_c']['labelValue']='Facebook Username';

in

custom/Extension/modules/Contacts/Ext/Vardefs/sugarfield_facebook_username_c.php

Does that make a difference?

Thanks,
Jim

Thanks Jim, but unfortunately it did not do the trick.

Even after a Quick Repair and Rebuild?

1 Like

Was not aware of that.
And YES, that fixed it!

Thanks a lot, Jim. Karma for you :slight_smile:

Andreas

1 Like