Skip Navigation

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.

Sun Mon Tue Wed Thu Fri Sat
- - 9:00 – 18:00 9:00 – 18:00 9:00 – 18:00 9:00 – 18:00 9:00 – 18:00
- - - - - - -

Supporter timezone: America/Lima (GMT-05:00)

This topic contains 1 reply, has 2 voices.

Last updated by Andreas W. 1 year, 1 month ago.

Assisted by: Andreas W..

Author Posts
November 23, 2023 at 2:33 pm #14909185

Verbal

Hello,

When cancelling a WooCommerce Booking related to a non-translated product with a non-translated reource, a fatal error is triggered in /wp-content/plugins/woocommerce-bookings/templates/emails/customer-booking-cancelled.php

After the booking is cancelled, the resource is missing in the booking which now displays "It appears the booking product associated with this booking has been removed." (the booking/resource still exist, but the reference in the booking is missing).

Une erreur de type E_ERROR a été causée dans la ligne 49 du fichier [...]/wp-content/plugins/woocommerce-bookings/templates/emails/customer-booking-cancelled.php. Message d'erreur : Uncaught Error: Call to a member function get_resource_label() on null in [...]/wp-content/plugins/woocommerce-bookings/templates/emails/customer-booking-cancelled.php:49
Stack trace:
#0 [...]/wp-content/plugins/woocommerce/includes/wc-core-functions.php(345): include()
#1 [...]/wp-content/plugins/woocommerce-bookings/includes/emails/class-wc-email-booking-cancelled.php(120): wc_get_template('emails/customer...', Array, 'woocommerce-boo...', '/www/formationc...')
#2 [...]/wp-content/plugins/woocommerce/includes/emails/class-wc-email.php(588): WC_Email_Booking_Cancelled->get_content_html()
#3 [...]/wp-content/plugins/woocommerce-bookings/includes/emails/class-wc-email-booking-cancelled.php(103): WC_Email->get_content()
#4 [...]/wp-content/plugins/woocommerce-multilingual/compatibility/WcBookings/Emails.php(182): WC_Email_Booking_Cancelled->trigger(64711)
#5 [internal function]: WCML\Compatibility\WcBookings\Emails->sendWithoutDuplicates(64711, 'WC_Email_Bookin...', 0)
#6 [...]/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/functions.php(83): call_user_func_array(Array, Array)
#7 [internal function]: WPML\FP\{closure}('WC_Email_Bookin...', 0)
#8 [...]/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/collect/src/Illuminate/Support/Collection.php(603): array_map(Object(Closure), Array, Array)
#9 [...]/wp-content/plugins/woocommerce-multilingual/compatibility/WcBookings/Emails.php(163): WPML\Collect\Support\Collection->map(Object(Closure))
#10 [...]/wp-includes/class-wp-hook.php(326): WCML\Compatibility\WcBookings\Emails->WCML\Compatibility\WcBookings\{closure}(64711)
#11 [...]/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters('', Array)
#12 [...]/wp-includes/plugin.php(565): WP_Hook->do_action(Array)
#13 [...]/wp-content/plugins/woocommerce/includes/class-wc-emails.php(170): do_action_ref_array('woocommerce_boo...', Array)
#14 [...]/wp-includes/class-wp-hook.php(324): WC_Emails::send_transactional_email(Array, Object(WC_Booking))
#15 [...]/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters('', Array)
#16 [...]/wp-includes/plugin.php(517): WP_Hook->do_action(Array)
#17 [...]/wp-content/plugins/woocommerce-bookings/includes/data-objects/class-wc-booking.php(351): do_action('woocommerce_boo...', 64711, Object(WC_Booking))
#18 [...]/wp-content/plugins/woocommerce-bookings/includes/data-objects/class-wc-booking.php(252): WC_Booking->status_transitioned_handler('Pay\xC3\xA9e', 'Annul\xC3\xA9')
#19 [...]/wp-content/plugins/woocommerce-bookings/includes/data-objects/class-wc-booking.php(217): WC_Booking->status_transition()
#20 [...]/wp-content/plugins/woocommerce-bookings/includes/admin/class-wc-bookings-details-meta-box.php(671): WC_Booking->save()
#21 [...]/wp-includes/class-wp-hook.php(326): WC_Bookings_Details_Meta_Box->meta_box_save(64711, Object(WP_Post))
#22 [...]/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters(NULL, Array)
#23 [...]/wp-includes/plugin.php(517): WP_Hook->do_action(Array)
#24 [...]/wp-includes/post.php(4760): do_action('save_post', 64711, Object(WP_Post), true)
#25 [...]/wp-includes/post.php(4862): wp_insert_post(Array, false, true)
#26 [...]/wp-admin/includes/post.php(453): wp_update_post(Array)
#27 [...]/wp-admin/post.php(227): edit_post()
#28 {main}
  thrown
November 23, 2023 at 5:26 pm #14910725

Andreas W.
Supporter

Languages: English (English ) Spanish (Español ) German (Deutsch )

Timezone: America/Lima (GMT-05:00)

Hello,

I have tried to recreate the issue on the following test site, but can not confirm it yet:
hidden link

Could you please try it for yourself?

It might be that this issue is further related to another plugin. Anyhow, the error points to the e-mail template used by WC Bookings and mentions also WCML and WPML.

As the issue does occur even on an original and untranslated product, we need to verify if the issue persists, once you disable WooCommerce Multilingual, WPML, and our addons.

If the issue is not occurring without our plugins, then we need to run further tests.

Do you maybe have a staging site ready for testing? If not, then I can offer to try to create a copy with "All In One WP Migration".

Best regards
Andreas

The topic ‘[Closed] Woocommerce Bookings Call to a member function get_resource_label() on null’ is closed to new replies.