Announcement

Collapse
No announcement yet.

can't find email address

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • can't find email address

    Error 500 appears when trying to find a contact email.

    Error text from the log file:
    [2020-11-15 16:32:48] Espo.ERROR: (42000) SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ' ' ', user.middle_name) LIKE 'vbk%'))) OR ((user.id IN (SELECT entity_email_a...' at line 1; GET /EmailAddress/action/searchInAddressBook; line: 93, file: ...../application/Espo/ORM/SthCollection.php [] []

    Link to complete log file: https://yadi.sk/d/g5UnE4VZTnC8CA

    An error occurs in such a SQL request:
    SELECT DISTINCT user.id AS `id`, emailAddresses.name AS `emailAddress`, REPLACE(TRIM(CONCAT(IFNULL(user.last_name, ''), ' ', IFNULL(user.first_name, ''), ' ', IFNULL(user.middle_name, ''))), ' ', ' ') AS `name`, user.first_name AS `firstName`, user.last_name AS `lastName`, user.user_name AS `userName` FROM `user` LEFT JOIN `entity_email_address` AS `emailAddressesMultipleMiddle` ON user.id = emailAddressesMultipleMiddle.entity_id AND emailAddressesMultipleMiddle.deleted = 0 AND emailAddressesMultipleMiddle.entity_type = 'User' LEFT JOIN `email_address` AS `emailAddressesMultiple` ON emailAddressesMultiple.id = emailAddressesMultipleMiddle.email_address_id AND emailAddressesMultiple.deleted = 0 LEFT JOIN `entity_email_address` AS `emailAddressesMiddle` ON user.id = emailAddressesMiddle.entity_id AND emailAddressesMiddle.deleted = 0 AND emailAddressesMiddle.primary = 1 AND emailAddressesMiddle.entity_type = 'User' LEFT JOIN `email_address` AS `emailAddresses` ON emailAddresses.id = emailAddressesMiddle.email_address_id AND emailAddresses.deleted = 0 WHERE ((((user.last_name LIKE 'qqh%' OR user.first_name LIKE 'qqh%' OR user.middle_name LIKE 'qqh%' OR CONCAT(user.first_name, ' ', user.last_name) LIKE 'qqh%' OR CONCAT(user.last_name, ' ', user.first_name) LIKE 'qqh%' OR CONCAT(user.last_name, ' ', , ' ', user.middle_name) LIKE 'qqh%'))) OR ((user.id IN (SELECT entity_email_address.entity_id AS `entityId` FROM `entity_email_address` JOIN `email_address` AS `emailAddress` ON emailAddress.id = entity_email_address.email_address_id AND emailAddress.deleted = 0 WHERE entity_email_address.deleted = 0 AND entity_email_address.entity_type = 'User' AND emailAddress.lower LIKE 'qqh%')))) AND ((emailAddressesMultiple.lower IS NOT NULL)) AND (user.type NOT IN ('api','system','super-admin')) AND (user.type <> 'super-admin') AND (user.type <> 'system') AND user.deleted = 0 ORDER BY user.last_name ASC, user.first_name ASC LIMIT 0, 20

    details on "screen3.png"

  • #2
    Try temporarily to change a person name format to a format w/o middle name.

    Comment


    • #3
      This fix should help: https://github.com/espocrm/espocrm/c...8b1abf5f727cf4

      Comment


      • #4
        Заработало! Спасибо большое.

        Да тут русские все... а я с переводчиком маялся.

        Ребят, спасибо еще раз.

        Comment

        Working...
        X