• Resolved Camilo

    (@camiloluna)


    I’m getting a fatal error on the latest (10.6.1) version of the plugin as described below.

    Error

    Uncaught TypeError: WC_Stripe_Plugins_Page_Controller::enqueue_scripts():
    Argument #1 ($hook_suffix) must be of type string, null given,
    called in wp-includes/class-wp-hook.php on line 324
    and defined in plugins/woocommerce-gateway-stripe/includes/admin/class-wc-stripe-plugins-page-controller.php:38

    Stack trace shows the action being dispatched from iframe_header() (wp-admin/includes/template.php:2156), which Event Tickets calls from Tribe__Tickets__Admin__Move_Tickets::dialog().

    Steps to reproduce

    1. Activate WooCommerce, WooCommerce Stripe Gateway, and The Events Calendar + Event Tickets.
    2. Create an event with tickets and at least one attendee.
    3. Go to Events → Attendees, select an attendee, choose Move.
    4. The “Move Attendees” iframe dialog opens and the request fatals.

    Root cause

    WC_Stripe_Plugins_Page_Controller::enqueue_scripts() declares a strict string $hook_suffix parameter:

    public function enqueue_scripts( string $hook_suffix ) {
        if ( 'plugins.php' !== $hook_suffix ) { return; }
        ...
    }

    WordPress core’s iframe_header() calls do_action( 'admin_enqueue_scripts', $hook_suffix ) using the global $hook_suffix, which is null in any iframe context where the global was never populated (Event Tickets’ Move Attendees and Move Tickets dialogs, Press This, the legacy plugin upload iframe, etc.). With a strict scalar typehint and no nullable annotation, the call fatals on PHP 7+.

    Suggested fix (with AI help)

    Either:

    • Relax the signature to ?string $hook_suffix = null and treat null as “not on plugins.php”, or
    • Cast at the boundary: $hook_suffix = is_string( $hook_suffix ) ? $hook_suffix : ''; before the equality check.

    Either avoids the TypeError without changing existing behavior — the method already early-returns for anything that isn’t ‘plugins.php’.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support Frank Remmy (woo-hc)

    (@frankremmy)

    Hi @camiloluna,

    Thank you for the detailed report and for digging into the root cause. That’s really helpful!

    Good news: this exact issue has already been fixed. The patch was merged two weeks ago: https://github.com/woocommerce/woocommerce-gateway-stripe/pull/5346, and will be included in the upcoming 10.7.0 release.

    Once 10.7.0 is available, updating should resolve the fatal error entirely and you’ll be able to move tickets between events without running into it again. If you’ve rolled back to an earlier version in the meantime, just update to 10.7.0 when it’s out and you’ll be all set.

    I hope that helps. Let us know if you need anything else.

    Thread Starter Camilo

    (@camiloluna)

    Hi @frankremmy,

    Appreciate the promptly reply!

    Since a fix is already on the way, I’ll mark this as resolved and will reopen if needed in the future.

    Plugin Support shahzeen(woo-hc)

    (@shahzeenfarooq)

    Hi there!

    Thank you for your cooperation and understanding.

    Before you go, If you’ve found the Stripe Gateway for WooCommerce plugin helpful for your store, we’d really appreciate a 5-star review here: https://wordpress.org/support/plugin/woocommerce-gateway-stripe/reviews/#new-post

Viewing 3 replies - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.