Skip Navigation

This thread is resolved. Here is a description of the problem and solution.

Problem:
The client is experiencing an issue with the Vikrentcar plugin on their English website, which requires a modification in the database handling code.
Solution:
We recommend backing up your website before attempting any fixes. Navigate to the

wp-content/plugins/vikrentcar/libraries/adapter/database/database.php

file. In the

JDatabase::loadObjectList

function, modify the existing code from:

if (is_array($this->result)) {<br />return $this->result;<br />}

to:

if (is_array($this->result)) {<br />foreach ($this->result as $row => $obj) {<br />if (isset($obj->post_id)) {<br />this->result[$row]->post_id = apply_filters('wpml_object_id', $this->result[$row]->post_id, 'page' );<br />}<br />}<br />return $this->result;<br />}

If this solution does not resolve your issue or seems irrelevant due to being outdated or not applicable to your case, we highly recommend checking related known issues at https://wpml.org/known-issues/, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If further assistance is needed, please open a new support ticket at WPML support forum.

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: 

This topic contains 9 replies, has 2 voices.

Last updated by Kor 2 days, 15 hours ago.

Assisted by: Kor.

Author Posts
October 8, 2024 at 10:54 am #16265033

alexandrosK-5

Now the problem is on english hidden link

October 8, 2024 at 5:00 pm #16266883

Kor
Supporter

Languages: English (English )

Timezone: Asia/Singapore (GMT+08:00)

Thanks for your patience. I've opened a new report and forwarded to our 2nd Tier Support. I will come back to you once I hear from them.

October 9, 2024 at 6:06 pm #16271969

Kor
Supporter

Languages: English (English )

Timezone: Asia/Singapore (GMT+08:00)

Thanks for your reply. Just letting you know that our 2nd Tier Support is still checking on this and I will come back to you soon.

October 10, 2024 at 3:30 pm #16276277

Kor
Supporter

Languages: English (English )

Timezone: Asia/Singapore (GMT+08:00)

Thanks for your patience.

I've feedback from our 2nd Tier Support and they shared a workaround. Please backup and try the workaround below.

Navigate to wp-content/plugins/vikrentcar/libraries/adapter/database/database.php
There in the function \JDatabase::loadObjectList in the code:

if (is_array($this->result))
{
return $this->result;
}

change it to:

	if (is_array($this->result))
		{
			foreach ($this->result as $row => $obj){
				if (isset($obj->post_id)) {
					$this->result[$row]->post_id = apply_filters( 'wpml_object_id', $this->result[$row]->post_id, 'page' );
				}
			}
			return $this->result;
		}

Let me know how it goes.

October 10, 2024 at 3:31 pm #16276286

Kor
Supporter

Languages: English (English )

Timezone: Asia/Singapore (GMT+08:00)

If the workaround works, please contact the plugin author and ask them to join our 'Go Global' program (https://wpml.org/documentation/support/go-global-program/) where our Compatibility developers will help them make their product 100% compatible with WPML for free.

If not, please let me know how it goes.

October 12, 2024 at 9:49 am #16281899

alexandrosK-5

No, its not working.

October 13, 2024 at 7:32 pm #16283517

Kor
Supporter

Languages: English (English )

Timezone: Asia/Singapore (GMT+08:00)

Thanks for your reply. Are you working on your staging site? Could you please grant me access to the site you're working on?

October 15, 2024 at 1:29 pm #16291091

Kor
Supporter

Languages: English (English )

Timezone: Asia/Singapore (GMT+08:00)

Thanks for your reply.

It worked when we tested it on our staging site. Can I have your permission to apply the fix directly on your production site? If you agree, please backup the site and let me know.

October 15, 2024 at 3:40 pm #16291756

alexandrosK-5

Hello.

Yes, you have my permission to apply the fix directly on my production site.

October 15, 2024 at 5:34 pm #16292217

Kor
Supporter

Languages: English (English )

Timezone: Asia/Singapore (GMT+08:00)

Thanks for your reply. Ok, please check now.

October 16, 2024 at 5:47 am #16293185

alexandrosK-5

Yes it is working now!
Thanks!
What was the problem?

alexandrosK-5 confirmed that the issue was resolved on 2024-10-16 05:47:49.
This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.