7.x upgrades. */ /** * Warn about namespace and function name changes. */ function coder_review_uc3x_reviews() { $rules = array( // Ubercart hook names were namespaced. array( '#type' => 'regex', '#value' => '(? 'all', '#never' => 'function theme', '#warning_callback' => '_coder_review_uc3x_hook_warning', ), // Private functions were moved into uc_ namespace. array( '#type' => 'regex', // (? '\b(? 'all', '#warning_callback' => '_coder_review_uc3x_function_warning', ), // Theme functions were namespaced. array( '#type' => 'regex', '#value' => 'theme\([\'"](address_pane|cart_review_table|summary_overview)[\'"]', '#warning_callback' => '_coder_review_uc3x_function_warning', ), // TAPIr table ids were namespaced. array( '#type' => 'regex', '#value' => '(? 'allphp', '#warning_callback' => '_coder_review_uc3x_function_warning', ), // uc_payment_process() is now uc_payment_process_payment(). array( '#type' => 'regex', '#value' => '\buc_payment_process\s*\(', '#warning' => 'uc_payment_process() is now uc_payment_process_payment() because of hook_process().', ), // Checkout and order pane callback arguments changed. array( '#type' => 'regex', '#value' => 'pane.*\(\$op,\s*&?\$(arg1|order)(,\s*&?\$arg2)?', '#never' => '\(\$op,\s*&?\$order,\s*&?\$form\s*=\s*NULL,\s*&\$form_state\s*=\s*NULL\)', '#warning' => 'Checkout and order pane callbacks take the arguments ($op, $order, &$form = NULL, &$form_state = NULL).', ), // uc_price() removed. array( '#type' => 'grep', '#value' => 'uc_price(', '#warning' => 'The function uc_price() was removed.', ), // hook_uc_price_handler() removed. array( '#type' => 'regex', '#value' => '\B_uc_price_handler\(', '#warning' => 'hook_uc_price_handler() was removed.', '#severity' => 'normal', ), // theme_uc_price() has only one argument. array( '#type' => 'regex', '#value' => 'theme\s*\(\s*[\'"]uc_price[\'"]\s*,[^,]+,', '#warning' => 'theme_uc_price() takes only one argument: "price", which is a float.', ), // Specify the allowed arguments to theme_uc_product_price() before it is ported. array( '#type' => 'regex', '#value' => 'theme\s*\(\s*[\'"]uc_product_price[\'"]\s*,[^,]+,', '#not' => '[\'"]#price', '#warning' => 'theme_uc_product_price() takes a render element with a "#value" and optional "#title" and "#attributes".' ), ); $review = array( '#title' => t('Converting Ubercart 2.x modules to 3.x'), '#rules' => $rules, '#severity' => 'critical', ); return array('ubercart3x' => $review); } function _coder_review_uc3x_hook_warning() { return array( '#warning' => 'Ubercart hooks have been namespaced with "uc_" in the front.', '#link' => 'http://drupal.org/node/510382', ); } function _coder_review_uc3x_function_warning() { return array( '#warning' => 'Ubercart private functions, theme functions, and TAPIr table ids have been namespaced with "uc_" in the front.', '#link' => 'http://drupal.org/node/750784', ); }