Loading...
 
Skip to main content

SQL error saving a Contact

Status
Closed
Subject
SQL error saving a Contact
Version
12.x
Category
  • Error
Feature
Contact (address book)
Resolution status
New
Submitted by
Telesight
Volunteered to solve
Jean-Marc Libs
Lastmod by
Jean-Marc Libs
Rating
(0)
Description

As a registered user I try to create a contact, I click on the save button and then I get the following page with this error (By the way the contact is saved):

The following error message was returned:

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 'AS x FROM `tiki_webmail_contacts_ext` AS x LEFT JOIN `tiki_webmail_contacts_fiel' at line 1

The query was:
DELETE `tiki_webmail_contacts_ext`.* AS x FROM `tiki_webmail_contacts_ext` AS x LEFT JOIN `tiki_webmail_contacts_fields` AS f ON x.`fieldId`=f.`fieldId`WHERE x.`contactId`=? AND f.`flagsPublic`='n' AND f.`user`=?

Values:

1. 2
2. John Doe

The built query was likely:
DELETE `tiki_webmail_contacts_ext`.* AS x FROM `tiki_webmail_contacts_ext` AS x LEFT JOIN `tiki_webmail_contacts_fields` AS f ON x.`fieldId`=f.`fieldId`WHERE x.`contactId`='2' AND f.`flagsPublic`='n' AND f.`user`='John Doe'


The extra fields like "City" and so on, are not saved.
Logged in as a admin I do not get this fault (not on my own installation nor on the show.tikiwiki.org)
I have seen this error in version 11 too, but did not pay attention to it because it was my first use of Tiki.

Solution

The SQL error made the whole site get in error mode when a normal user adds a contact.
SQL query obviously wrong and easy to fix.

Funny thing is, no error in Tiki 9.x, yet the query is the same there.

Committed revision 49381. Thank you for the report

Importance
10 high
Easy to solve?
9
Priority
90
Demonstrate Bug on Tiki 19+
Demonstrate Bug (older Tiki versions)
Ticket ID
5097
Created
Tuesday 14 January, 2014 13:03:39 UTC
by Telesight
LastModif
Tuesday 14 January, 2014 20:40:25 UTC


Show PHP error messages