• First of all thank you for a great plugin. It was updated 2 months ago and still works flawlesly.

    However The latest version contains a small but that mainly appears on the users page in wp-admin.
    It’s visible if you use the query monitor and has something to do with the way the hooks are implemented. Obviously they do not need to fire in wp-admin. Only on the checkout page.

    Here is the error:
    Fatal error: Uncaught Error: call_user_func_array(): Argument #1 ($callback) must be a valid callback, class WC_Piraeusbank_Gateway does not have a method “add_woocommerce_customer_meta_fields”
    in /home/user/public_html/wp-includes/class-wp-hook.php on line 324

    Call stack:

    1. WP_Hook::apply_filters()
      wp-includes/plugin.php:205
    2. apply_filters()
      wp-content/plugins/woocommerce/includes/admin/class-wc-admin-profile.php:147
    3. WC_Admin_Profile::get_customer_meta_fields()
      wp-content/plugins/woocommerce/includes/admin/class-wc-admin-profile.php:166
    4. WC_Admin_Profile::add_customer_meta_fields()
      wp-includes/class-wp-hook.php:324
    5. WP_Hook::apply_filters()
      wp-includes/class-wp-hook.php:348
    6. WP_Hook::do_action()
      wp-includes/plugin.php:517
    7. do_action()
      wp-admin/user-edit.php:875
    8. require_once()
      wp-admin/profile.php:18

    Search your installations… you know it to be true…
    Is there a way to have a fix on that?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter escozul

    (@escozul)

    Hello,
    just a quick update.
    I had to go into the plugin code on line 151 and replace it with the following:

    if (!isset($_SERVER[‘REQUEST_URI’]) || false === strpos($_SERVER[‘REQUEST_URI’], ‘wp-admin/profile.php’)) {

    ? ? ? ? add_filter( ‘woocommerce_customer_meta_fields’ , [$this, ‘add_woocommerce_customer_meta_fields’]);

    }

    It’s a temporary fix that brought back control of my users. I look forward for a more permanent fix.

    Thank you.

    I use your code and it fix it for admin user but not for other roles like shop manager. I found a beter fix that works with every role.

    if (is_admin() && function_exists(‘get_current_screen’)) {
    $screen = get_current_screen();
    if ($screen && $screen->id === ‘profile’) {
    add_filter(‘woocommerce_customer_meta_fields’, [$this, ‘add_woocommerce_customer_meta_fields’]);
    }
    }

    For sure this is a temporary fix

    Thread Starter escozul

    (@escozul)

    Love it!

    Much better. Didn’t notice that my function would not work if queries were added to the url (weird… I used strpos… AAAnyway)

    please be carefull with your single quotes. They seem non-standard. Had to change them to avoid errors.

    In any case, I hope this fix is indeed here for just a couple of days and the guys at papaki will fix the thing for us.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Issue on version 1.7.1’ is closed to new replies.