This is the technical support forum for WPML - the multilingual WordPress plugin.
Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.
Tagged: Compatibility, Exception
This topic contains 3 replies, has 0 voices.
Last updated by khaledA-37 4 weeks ago.
Assisted by: Marcel.
| Author | Posts |
|---|---|
| April 5, 2026 at 11:22 am #17949989 | |
|
khaledA-37 |
I have an English installation that is working fine, however, when I translated the site to Arabic, the content was translated correctly with no issues, however, the booking system in the Arabic version is not working, it is displayed correctly but the submit button is not working. |
| April 7, 2026 at 1:13 pm #17954363 | |
|
Marcel Supporter
Languages: English (English ) Spanish (Español ) German (Deutsch ) Timezone: Europe/Vienna (GMT+02:00) |
Hi, do you have a staging environment where I could take a look? Ideally, it would be helpful if you could include an example booking entry so I can reproduce the issue. I would eventually also need to request temporary access (WP-Admin and FTP) to your site Your next answer will be private which means only you and I have access to it. ❌ Please backup your database and website ❌ ✙ I would additionally need your permission to de-activate and re-activate Plugins and the Theme, and to change configurations on the site. This is also a reason the backup is really important. ✙ Please add the Links to the […] Edit Screen, the Page/Post where you insert the […] and the corresponding Front End Page/Screen Thank you! Best regards, |
| April 10, 2026 at 5:48 am #17961013 | |
|
Marcel Supporter
Languages: English (English ) Spanish (Español ) German (Deutsch ) Timezone: Europe/Vienna (GMT+02:00) |
Hi Khaled, thanks for the access! What is happening is a fatal error based on JS console: jquery.min.js?ver=3.7.1:2 POST <em><u>hidden link</u></em> 500 (Internal Server Error) send @ jquery.min.js?ver=3.7.1:2 ajax @ jquery.min.js?ver=3.7.1:2 (anonymous) @ jquery-migrate.min.js?ver=3.4.1:2 (anonymous) @ jquery-migrate.min.js?ver=3.4.1:2 tourmaster_room_booking_ajax @ tourmaster-room.js?ver=6.9.4:118 (anonymous) @ tourmaster-room.js?ver=6.9.4:543 dispatch @ jquery.min.js?ver=3.7.1:2 ce.event.add.v.handle @ jquery.min.js?ver=3.7.1:2 I activated the WP debug log and this is happening:
[10-Apr-2026 05:28:28 UTC] PHP Fatal error: Uncaught TypeError: sizeof(): Argument #1 ($value) must be of type Countable|array, string given in /customers/2/3/9/***/webroots/fefcb5cd/wp-content/plugins/tourmaster/room/include/booking-bar.php:596
Stack trace:
#0 /customers/2/3/9/***/webroots/fefcb5cd/wp-content/plugins/tourmaster/room/include/booking-bar.php(754): tourmaster_check_package_date('', '2026-04-12')
#1 /customers/2/3/9/***/webroots/fefcb5cd/wp-content/plugins/tourmaster/room/include/booking-bar.php(487): tourmaster_room_price_breakdown(Array, true)
#2 /customers/2/3/9/***/webroots/fefcb5cd/wp-content/plugins/tourmaster/room/include/booking-bar.php(449): tourmaster_room_booking_bar_summary(Array)
#3 /customers/2/3/9/***/webroots/fefcb5cd/wp-includes/class-wp-hook.php(341): tourmaster_room_booking_form_ajax('')
#4 /customers/2/3/9/***/webroots/fefcb5cd/wp-includes/class-wp-hook.php(365): WP_Hook->apply_filters('', Array)
#5 /customers/2/3/9/***/webroots/fefcb5cd/wp-includes/plugin.php(522): WP_Hook->do_action(Array)
#6 /customers/2/3/9/***/webroots/fefcb5cd/wp-admin/admin-ajax.php(192): do_action('wp_ajax_tourmas...')
#7 {main}
thrown in /customers/2/3/9/***/webroots/fefcb5cd/wp-content/plugins/tourmaster/room/include/booking-bar.php on line 596
The first argument is an empty string (''), but the function expects something countable (likely an array of dates or packages). The plugin fails in Arabic because it cannot parse localized Arabic date strings, resulting in invalid (empty) data being passed where an array is expected. This leads to a PHP 8 fatal error when count()/sizeof() is called on a string instead of a valid array. I would recommend. you to reach out ot the plugin authors to inform them about it. A good starting fix would be to ensure the plugin does not rely on localized date strings for processing. Instead, all incoming dates (from the frontend/AJAX) should be converted into a standard format like YYYY-MM-DD before being used internally. Additionally, adding a safeguard like is_countable() before calling count()/sizeof() would prevent crashes when invalid data is received. I attempted to apply a temporary workaround, but unfortunately the site crashed. Could you please restore the original file at: You can find the original code here: https://pastebin.com/4nJLx6a5 Best regards, |
| April 13, 2026 at 7:23 am #17964820 | |
|
Marcel Supporter
Languages: English (English ) Spanish (Español ) German (Deutsch ) Timezone: Europe/Vienna (GMT+02:00) |
Hi Khaled, thanks! I added the following workaround:
if( !function_exists('tourmaster_check_package_date') ){
function tourmaster_check_package_date($package_date, $date){
// SAFETY: ensure array
if( !is_array($package_date) ){
return 0;
}
if( count($package_date) <= 1 ) return 0;
for($i = 0; $i < count($package_date); $i++ ){
if( isset($package_date[$i]) && strpos($package_date[$i], $date) !== false ){
return $i;
}
}
return 0;
} // tourmaster_check_package_date
}
I recommend reaching out to the authors so they can investigate this and potentially add a solution to their codebase. Best Regards, |
| April 14, 2026 at 11:01 am #17968273 | |
|
khaledA-37 |
Many thanks Marcel, the book button now works, if the workaround won't change (due to updates or anything else) then all seems good to me Many thanks for your help Khaled |