Support » Plugin: Bus Ticket Booking with Seat Reservation » [NSFW] unserialize() expects parameter 1 to be string

  • Resolved knaveenchand

    (@knaveenchand)


    After the update, I got this error:

    Warning: unserialize() expects parameter 1 to be string, array given in /wp-content/plugins/bus-ticket-booking-with-seat-reservation/public/template-hooks/layout/bus-search-page.php on line 55

    The problem perhaps is with the Buffer Time calculation code in bus-search-page.php:

    // Buffer Time Calculation
            $bus_bp_array = get_post_meta($id, 'wbtm_bus_bp_stops', true);
            $bus_bp_array = unserialize($bus_bp_array);
            $bp_time = $wbtmmain->wbtm_get_bus_start_time($start, $bus_bp_array);
            $is_buffer = $wbtmmain->wbtm_buffer_time_check($bp_time, date('Y-m-d', strtotime($j_date)));
            // Buffer Time Calculation END

    I fixed it as follows:

    // Buffer Time Calculation
            $bus_bp_array = get_post_meta($id, 'wbtm_bus_bp_stops', true);
            $bus_bp_array = unserialize(serialize($bus_bp_array));
            $bp_time = $wbtmmain->wbtm_get_bus_start_time($start, $bus_bp_array);
            $is_buffer = $wbtmmain->wbtm_buffer_time_check($bp_time, date('Y-m-d', strtotime($j_date)));
            // Buffer Time Calculation END

    Since the output is anyway coming as an array, there is no need to unserialise it. Plugin author may pls fix this. Others may use the above code in the interim.

Viewing 2 replies - 1 through 2 (of 2 total)
  • hi knaveenchand .. i have problem with calculation total for this plugin. Total value charge for adult and infant on checkout wocommerce event i only pick 1 seat only for infant. did you have same problem to?

    Plugin Contributor Md. Abdullah Al Mahim

    (@aamahin)

    Hello @papazola & @knaveenchand

    Thanks for your message, We released a new version 2.2 today. Please update your plugin i hope the issues you reported will be solved after this update.

    Let me know if you have any questions.

    Regards.

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.