• Resolved Phil Donaldson

    (@philanyware)


    I found a bug with Delivery Drivers after updating to PHP8. It gives a critical error when using the bulk assign function in WooCommece Orders admin.
    wp-content/plugins/delivery-drivers-for-woocommerce/admin/class-ddwc-admin.php, function ddwc_driver_edit_handle_bulk_action

    The “INPUT_REQUEST” constant was never created but php7 must have allowed it. Changing to INPUT_GET in 4 places fixed the problem. You can edit this code to make the error go away.
    The lines commented out with // are the old version. The line below it is the updated version.

    // Only run code if the bulk action is changing to Driver Assigned.
    //if ( null !== filter_input( INPUT_REQUEST, ‘mark_driver-assigned’ ) && 1 == filter_input( INPUT_REQUEST, ‘changed’ ) ) {
    if ( null !== filter_input( INPUT_GET, ‘mark_driver-assigned’ ) && 1 == filter_input( INPUT_GET, ‘changed’ ) ) {
    // Get order.
    $order = new WC_Order( $post_id );
    // Order note.
    $order_note = esc_attr__( ‘That\’s what happened by bulk edit:’, ‘delivery-drivers-for-woocommerce’ );
    // Update order status.
    $order->update_status( ‘driver-assigned’, $order_note, true );
    // Save order.
    $order->save();
    // Action hook.
    do_action( ‘ddwc_mark_driver_assigned’, $post_id );
    }

    I tried sending this fix to the developer but I think the project has been abandoned. I hope others find this fix useful.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Robert DeVore

    (@deviodigital)

    Thank you for letting us know about the issue. I’ve verified it on my end and am pushing out a fix later today for this issue.

    The project is not abandoned. Regular updates were on hiatus for a while but there will be more frequent updates going forward as we have plans for some major upgrades in 2024 ??

    Thread Starter Phil Donaldson

    (@philanyware)

    Thank you. That’s great news. ??

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘PHP8 critical error using bulk assign function’ is closed to new replies.