CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • FUNCTION civicrm_strip_non_numeric Does not exist
Pages: [1] 2 3 4

Author Topic: FUNCTION civicrm_strip_non_numeric Does not exist  (Read 9711 times)

mpdas108

  • I’m new here
  • *
  • Posts: 11
  • Karma: 0
  • CiviCRM version: 4.4.6
  • CMS version: Wordpress 3.9.2
FUNCTION civicrm_strip_non_numeric Does not exist
May 06, 2013, 08:56:00 am
Hello when a user tries to fill out an online contribution page and confirm. They receive a DB Error: unknown error. Upon examination with debugging enabled, civicrm seems to be having trouble with the following function:

"civicrm_strip_non_numeric"

Here is the backtrace:

Array
(
    [message] => DB Error: unknown error
    [mode] => 16
    [debug_info] => INSERT INTO civicrm_phone (contact_id , location_type_id , is_primary , is_billing , phone , phone_type_id ) VALUES ( 1774 ,  1 ,  1 ,  0 , '2122536182' ,  1 )  [nativecode=1305 ** FUNCTION tovporg_civicrm.civicrm_strip_non_numeric does not exist]
    [type] => DB_Error
    [user_info] => INSERT INTO civicrm_phone (contact_id , location_type_id , is_primary , is_billing , phone , phone_type_id ) VALUES ( 1774 ,  1 ,  1 ,  0 , '2122536182' ,  1 )  [nativecode=1305 ** FUNCTION tovporg_civicrm.civicrm_strip_non_numeric does not exist]
    [to_string] => [db_error: message="DB Error: unknown error" code=-1 mode=callback callback=CRM_Core_Error::handle prefix="" info="INSERT INTO civicrm_phone (contact_id , location_type_id , is_primary , is_billing , phone , phone_type_id ) VALUES ( 1774 ,  1 ,  1 ,  0 , '2122536182' ,  1 )  [nativecode=1305 ** FUNCTION tovporg_civicrm.civicrm_strip_non_numeric does not exist]"]


If anyone could please help as I am stumped, I think it would be nice to update the database troubleshooting tools to work with the current version.

Thanks in advance!

mpdas108

  • I’m new here
  • *
  • Posts: 11
  • Karma: 0
  • CiviCRM version: 4.4.6
  • CMS version: Wordpress 3.9.2
Re: FUNCTION civicrm_strip_non_numeric Does not exist
May 06, 2013, 11:08:41 am
Oh and by the way, this is an installation of CiviCRM version 4.3.1 on Wordpress 3.5.1. I recently migrated from one sever to another, and upgraded from a fresh install of 4.3.0 to 4.3.1.

Yashodha Chaku

  • Forum Godess / God
  • Ask me questions
  • *****
  • Posts: 755
  • Karma: 57
    • CiviCRM
Re: FUNCTION civicrm_strip_non_numeric Does not exist
May 06, 2013, 01:58:43 pm
mpdas108 :

Can you confirm if you still this on latest CiviCRM (4.3.2)

-Yashodha
Found this reply helpful? Contribute NOW and help us improve CiviCRM with the Make it Happen! initiative.

mpdas108

  • I’m new here
  • *
  • Posts: 11
  • Karma: 0
  • CiviCRM version: 4.4.6
  • CMS version: Wordpress 3.9.2
Re: FUNCTION civicrm_strip_non_numeric Does not exist
May 07, 2013, 07:04:32 am
I have upgraded to 4.3.2, and the problem has seemed to have been solved. Thanks a lot!

Yashodha Chaku

  • Forum Godess / God
  • Ask me questions
  • *****
  • Posts: 755
  • Karma: 57
    • CiviCRM
Re: FUNCTION civicrm_strip_non_numeric Does not exist
May 07, 2013, 11:34:10 am
Cool!
Found this reply helpful? Contribute NOW and help us improve CiviCRM with the Make it Happen! initiative.

Slovak

  • I post occasionally
  • **
  • Posts: 89
  • Karma: 3
    • My website
  • CiviCRM version: 3.4.x, 4.2.x
  • CMS version: Drupal 6.x, 7.x
  • MySQL version: 5.5.29
  • PHP version: 5.3.10
Re: FUNCTION civicrm_strip_non_numeric Does not exist
May 08, 2013, 09:02:53 pm
I can confirm this behavior in 4.3.1 - will be upgrading to the latest version soon.

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: FUNCTION civicrm_strip_non_numeric Does not exist
May 13, 2013, 03:50:11 pm

peter

might want to ping colemanw on irc and get this sorted out. seems like the phone stored procedure is not getting into the mysql db for some reason

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

Coleman Watts

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 2346
  • Karma: 183
  • CiviCRM version: The Bleeding Edge
  • CMS version: Various
Re: FUNCTION civicrm_strip_non_numeric Does not exist
May 13, 2013, 04:12:40 pm
Note: The phone trigger stuff was written prior to the release of 4.3.0 (during the alpha stages) and there have been no changes to it since. Most likely the sporadic problems people have experienced have been due to triggers not being rebuilt at the end of the upgrade, possibly due to the script timing out. So in that case, upgrading to 4.3.3 "fixes" it not because of the new code but simply because the upgrade ran all the way this time and did its trigger rebuild.
You don't have to wait for a new version of CIviCRM to come out to fix this, you can also visit this url on your site:
.../civicrm/menu/rebuild?reset=1&triggerRebuild=1
« Last Edit: October 31, 2013, 11:43:40 am by Dave Greenberg »
Try asking your question on the new CiviCRM help site.

Slovak

  • I post occasionally
  • **
  • Posts: 89
  • Karma: 3
    • My website
  • CiviCRM version: 3.4.x, 4.2.x
  • CMS version: Drupal 6.x, 7.x
  • MySQL version: 5.5.29
  • PHP version: 5.3.10
Re: FUNCTION civicrm_strip_non_numeric Does not exist
May 13, 2013, 04:41:21 pm
Thanks Coleman, that resolved the issue!

Shai

  • I post frequently
  • ***
  • Posts: 202
  • Karma: 8
    • Content2zero
  • CiviCRM version: 4.3.x, 4.4.x, 4.5.x
  • CMS version: Drupal 7
  • MySQL version: 5.5.x
  • PHP version: 5.3.x, 5.4.x
Re: FUNCTION civicrm_strip_non_numeric Does not exist
May 20, 2013, 01:29:04 pm
I can enter any phone number in any phone field.

I tried rebuilding the trigger and it didn't work.

I'm using CiviCRM 4.3.3 on Drupal 7.22. DB is mysql 5.1.68-cll and PHP is 5.3.19.

This is the error in the log:

Code: [Select]
[info] $Fatal Error Details = Array
(
    [callback] => Array
        (
            [0] => CRM_Core_Error
            [1] => handle
        )

    [code] => -1
    [message] => DB Error: unknown error
    [mode] => 16
    [debug_info] => INSERT INTO civicrm_phone (contact_id , location_type_id , is_primary , is_billing , phone , phone_ext , phone_type_id ) VALUES ( 2 ,  1 ,  1 ,  0 , '123-456-7890' ,  NULL ,  1 )  [nativecode=1305 ** FUNCTION db_civicrm.civicrm_strip_non_numeric does not exist]
    [type] => DB_Error
    [user_info] => INSERT INTO civicrm_phone (contact_id , location_type_id , is_primary , is_billing , phone , phone_ext , phone_type_id ) VALUES ( 2 ,  1 ,  1 ,  0 , '123-456-7890 ,  NULL ,  1 )  [nativecode=1305 ** FUNCTION db_civicrm.civicrm_strip_non_numeric does not exist]
    [to_string] => [db_error: message="DB Error: unknown error" code=-1 mode=callback callback=CRM_Core_Error::handle prefix="" info="INSERT INTO civicrm_phone (contact_id , location_type_id , is_primary , is_billing , phone , phone_ext , phone_type_id ) VALUES ( 2 ,  1 ,  1 ,  0 , '123-456-7890' ,  NULL ,  1 )  [nativecode=1305 ** FUNCTION db_civicrm.civicrm_strip_non_numeric does not exist]"]
)
Don't miss out! Sign up now for free expert advice on CiviCRM's new StackExchange help site.

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: FUNCTION civicrm_strip_non_numeric Does not exist
May 21, 2013, 03:26:15 am
Quote from: Shai on May 20, 2013, 01:29:04 pm
I tried rebuilding the trigger and it didn't work.

What exactly did you try, like what query? And what was the result precisely? An error message?
CiviHosting and CiviOnline -- The CiviCRM hosting experts, since 2007

See here for the official: What to do if you think you've found a bug.

Shai

  • I post frequently
  • ***
  • Posts: 202
  • Karma: 8
    • Content2zero
  • CiviCRM version: 4.3.x, 4.4.x, 4.5.x
  • CMS version: Drupal 7
  • MySQL version: 5.5.x
  • PHP version: 5.3.x, 5.4.x
Re: FUNCTION civicrm_strip_non_numeric Does not exist
May 21, 2013, 06:53:29 am
@ Herschel, thanks for the response.

I navigate to /civicrm/menu/rebuild?reset=1&triggerRebuild=1

It takes me to /civicrm and produces no messages to the screen nor to /files/civicrm/ConfigandLog.

Is there a query that I can run directly with mysql? Seems like something is definitely missing from my db.

When I try to add or edit a phone number, the relevant part of the error written to ConfigandLog seems to be:
Quote
[nativecode=1305 ** FUNCTION mydb.civicrm_strip_non_numeric does not exist]"]

Thanks,

Shai
« Last Edit: October 31, 2013, 11:43:21 am by Dave Greenberg »
Don't miss out! Sign up now for free expert advice on CiviCRM's new StackExchange help site.

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: FUNCTION civicrm_strip_non_numeric Does not exist
May 21, 2013, 07:03:38 am
I suppose you could try to run this in MySQL:

Code: [Select]
  CREATE FUNCTION civicrm_strip_non_numeric(input VARCHAR(255) CHARACTER SET utf8)
      RETURNS VARCHAR(255) CHARACTER SET utf8
      DETERMINISTIC
      NO SQL
    BEGIN
      DECLARE output   VARCHAR(255) CHARACTER SET utf8 DEFAULT '';
      DECLARE iterator INT          DEFAULT 1;
      WHILE iterator < (LENGTH(input) + 1) DO
        IF SUBSTRING(input, iterator, 1) IN ('0', '1', '2', '3', '4', '5', '6', '7', '8', '9') THEN
          SET output = CONCAT(output, SUBSTRING(input, iterator, 1));
        END IF;
        SET iterator = iterator + 1;
      END WHILE;
      RETURN output;
    END

and see what happens.
CiviHosting and CiviOnline -- The CiviCRM hosting experts, since 2007

See here for the official: What to do if you think you've found a bug.

Shai

  • I post frequently
  • ***
  • Posts: 202
  • Karma: 8
    • Content2zero
  • CiviCRM version: 4.3.x, 4.4.x, 4.5.x
  • CMS version: Drupal 7
  • MySQL version: 5.5.x
  • PHP version: 5.3.x, 5.4.x
Re: FUNCTION civicrm_strip_non_numeric Does not exist
May 21, 2013, 07:10:14 am
Thanks,

That SQL returns the following error:
Quote
#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 '' at line 6

Do you see a typo in there or something?

Shai
Don't miss out! Sign up now for free expert advice on CiviCRM's new StackExchange help site.

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: FUNCTION civicrm_strip_non_numeric Does not exist
May 21, 2013, 07:17:24 am
That code is copied and pasted from the CiviCRM source code.

Someone else will respond now I think. I'm not sure what the issue is.
CiviHosting and CiviOnline -- The CiviCRM hosting experts, since 2007

See here for the official: What to do if you think you've found a bug.

Pages: [1] 2 3 4
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • FUNCTION civicrm_strip_non_numeric Does not exist

This forum was archived on 2017-11-26.