Guest Posted June 11, 2003 Posted June 11, 2003 This error occurred for me with Preview Release 2.2-CVS, since I added the Paypal IPN .971 overwrite and run: Warning: call_user_func() expects first argument, 'tep_get_order_status_name', to be a valid callback in /home/sites/www.perfumeparadise.ca/web/catalog/admin/includes/functions/general.php on line 1232 In admin/includes/functions/general.php the function that this is trying to call is tep_get_orders_status_name, but in the error listed here and the error I am getting it say: 'tep_get_order_status_name' So the question is, what file is calling this function with the wrong name? I am looking, but I can't find it. Quote
orchard Posted June 11, 2003 Posted June 11, 2003 I searched with AgentRansack and there are several references to tep_get_order_status_name. The one in includes/modules/payment/paypal.php is inside of a tep_db_query which I assume is why it is called a callback. Quote In olden times the men were made of iron and the ships were made of wood; now it's the other way around. :wink:
Guest Posted June 11, 2003 Posted June 11, 2003 Well, since I am talking about the paypalipn function the paypal.php does not apply. But you did send me in the right direction and I found what I was looking for. In includes/modules/payments/paypalipn.php Change this: # tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, use_function, date_added) values ('Set Order Status', 'MODULE_PAYMENT_PAYPALIPN_ORDER_STATUS_ID', '0', 'Set the status of orders made with this payment module to this value', '6', '14', 'tep_cfg_pull_down_order_statuses(', 'tep_get_order_status_name', now())"); To this: tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, use_function, date_added) values ('Set Order Status', 'MODULE_PAYMENT_PAYPALIPN_ORDER_STATUS_ID', '0', 'Set the status of orders made with this payment module to this value', '6', '14', 'tep_cfg_pull_down_order_statuses(', 'tep_get_orders_status_name', now())"); The only difference is that tep_get_order_status_name becomes tep_get_orders_status_name. This is the correct name of the function The error has now disappeared. Please note that I had to disable and then enable paypalIPN, for it to take effect. Quote
Guest Posted June 11, 2003 Posted June 11, 2003 Now that we solved that, when you click on the Edit button for the Paypal IPN module you get this error: Fatal error: Call to undefined function: tep_cfg_pull_down_order_statuses() in /home/drytush/public_html/store/admin/modules.php(204) : eval()'d code on line 1 So now we have to find out why tep_cfg_pull_down_order_statuses is undefined. Quote
Guest Posted June 12, 2003 Posted June 12, 2003 This is so weird. I have one store with 2.2-MS1 where the function called in paypalipn.php is order without the s and that one works fine. Except that one is having problems with the IPN test. Then I have a store that is Preview release 2.2-CVS and that is the one which had the problems discussed in this thread and the error was corrected with the change in the code I listed above. Both stores have IPN .971 installed. I can't figure this out. So strange. Quote
LostInPHP Posted June 12, 2003 Posted June 12, 2003 I used your fix and got rid of the one error code! woo hoo, but I too get that second error when I click the edit. Terri Quote Help me I'm lost in PHP and I don't have a map!
Guest Posted June 12, 2003 Posted June 12, 2003 Ok I found it. admin/includes/functions/general.php is missing the following code. This applies to the 2.2-CVS that is installed by cpanel6. Insert around line 1250, after this: return $classes['geo_zone_name']; } } function tep_cfg_pull_down_order_statuses($order_status_id, $key = '') { global $languages_id; $name = (($key) ? 'configuration[' . $key . ']' : 'configuration_value'); $statuses_array = array(array('id' => '0', 'text' => TEXT_DEFAULT)); $statuses_query = tep_db_query("select orders_status_id, orders_status_name from " . TABLE_ORDERS_STATUS . " where language_id = '" . $languages_id . "' order by orders_status_name"); while ($statuses = tep_db_fetch_array($statuses_query)) { $statuses_array[] = array('id' => $statuses['orders_status_id'], 'text' => $statuses['orders_status_name']); } return tep_draw_pull_down_menu($name, $statuses_array, $order_status_id); } function tep_get_order_status_name($order_status_id, $language_id = '') { global $languages_id; if ($order_status_id < 1) return TEXT_DEFAULT; if (!is_numeric($language_id)) $language_id = $languages_id; $status_query = tep_db_query("select orders_status_name from " . TABLE_ORDERS_STATUS . " where orders_status_id = '" . $order_status_id . "' and language_id = '" . $language_id . "'"); $status = tep_db_fetch_array($status_query); return $status['orders_status_name']; } and before this: //// // Return a random value Quote
Guest Posted June 12, 2003 Posted June 12, 2003 This also explains the discrepency with the get_order_status_name. This function is included here. So, I am not sure what to do about that. I will let you know. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.