This thread is resolved. Here is a description of the problem and solution.
Problem:
Can not edit page with Elementor in 2nd language when Hotel Booking plugin activated. I get error:
Uncaught TypeError: Illegal offset type in isset or empty in wp-content/plugins/sitepress-multilingual-cms/classes/core-abstract-classes/class-wpml-element-translation.php:259
Solution:
Change the code in wp-content/plugins/motopress-hotel-booking/includes/repositories/reserved-room-repository.php
from:
$bookingsIds = is_a( reset( $bookingsPosts ), '\WP_Post' ) ? wp_list_pluck( $bookingsPosts, 'ID' ) : $bookingsPosts;
- to:
$bookingsIds = is_a( ( $bookingsPosts ), '\WP_Post' ) ? ( $bookingsPosts->ID ) : $bookingsPosts;
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: Exception
This topic contains 12 replies, has 2 voices.
Last updated by mileD 1 year, 11 months ago.
Assisted by: Dražen Duvnjak.
Author | Posts |
---|---|
December 1, 2022 at 9:25 am | |
mileD |
Hi Dražen. My page is missing first picture on all language, it works only on default language how I wont. What is the best and fastest way to work on all languages as default? My booking also wont work on all languages, only on default. |
December 1, 2022 at 10:22 am | |
December 1, 2022 at 12:12 pm #12570597 | |
Dražen Duvnjak Supporter
Languages: English (English ) Timezone: Europe/Zagreb (GMT+01:00) |
Hello, the problem comes when the Hotel Booking plugin is enabled. I have checked and I can see you are using an older version of this plugin. Please update to the latest 4.5.0 version, and let me know how it goes. - hidden link Thanks, |
December 5, 2022 at 9:51 am #12589673 | |
mileD |
I update Hotell booking plugin to 4.5.0 version and problem is still here. |
December 5, 2022 at 11:19 am #12590437 | |
mileD |
Do I need to translate this? Maybe I did something wrong in translation, rates, accommodation, or home page translation.... |
December 5, 2022 at 12:17 pm #12591041 | |
Dražen Duvnjak Supporter
Languages: English (English ) Timezone: Europe/Zagreb (GMT+01:00) |
Hello, thanks, for getting back. I do not think it is related to any of those settings, you should be able to edit the page in Croatian with Elementor. I have shared this with our 2nd tier to check and dvise further. I will update you soon. Thanks, |
December 5, 2022 at 1:52 pm #12591875 | |
Dražen Duvnjak Supporter
Languages: English (English ) Timezone: Europe/Zagreb (GMT+01:00) |
Hello, I am trying to take a copy of your website so our 2nd tier deploys and debugs further, but I am having issues. Please try to create and share with us Duplicator package as explained here: - https://wpml.org/faq/provide-supporters-copy-site/ You might need to contact your hosting support as I see the process keeps getting canceled. Let me know how it goes. Thanks, |
December 6, 2022 at 5:39 pm #12601307 | |
mileD |
I did that end I have installer.php and zip file. I think that this is it. Will you download it or I can send it to you? If you wont me to send them tell me how where you wont to send them. |
December 6, 2022 at 5:44 pm #12601315 | |
mileD |
This message I got from motopress when I was asking them about my booking calendar: You should make sure to translate rates to other languages and also enable the option of copying media files from the primary language to secondary ones - this can be done while translating accommodation types Can You check that please? I think that I did something wrong with this....I do not know anymore.... |
December 7, 2022 at 7:38 am #12604343 | |
Dražen Duvnjak Supporter
Languages: English (English ) Timezone: Europe/Zagreb (GMT+01:00) |
Hello, I have downloaded and tried to deploy it, but is not working. So I have managed to create a new one. I have now escalated this issue further, will update you soon. Thanks, |
December 7, 2022 at 10:05 am #12605287 | |
Dražen Duvnjak Supporter
Languages: English (English ) Timezone: Europe/Zagreb (GMT+01:00) |
Hello, we have found a workaround you can use in this case: Change the code in wp-content/plugins/motopress-hotel-booking/includes/repositories/reserved-room-repository.php $bookingsIds = is_a( reset( $bookingsPosts ), '\WP_Post' ) ? wp_list_pluck( $bookingsPosts, 'ID' ) : $bookingsPosts; to: $bookingsIds = is_a( ( $bookingsPosts ), '\WP_Post' ) ? ( $bookingsPosts->ID ) : $bookingsPosts; Please note we are not sure if this change can cause any other issues with the mentioned plugin functions, so make sure to have a backup and test if it works fine for you. Regards, |
December 8, 2022 at 4:01 pm #12616141 | |
mileD |
Now works. What was wrong with code? How can I make that my calendar work with check in and check out form on all languages? And this will be it... |
December 9, 2022 at 6:29 am #12618977 | |
Dražen Duvnjak Supporter
Languages: English (English ) Timezone: Europe/Zagreb (GMT+01:00) |
Hello, great, thanks for confirming. It seems there is an issue with the plugin code that causes a bug with WPML, our compatibility team is notified of this. You can proceed to use the workaround shared. As for your 2nd issue, please open a new ticket and we will be glad to help, since we limit 1 issue per 1 ticket to keep things clear. Regards, |