Skip Navigation

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

Problem:
Properties, Taxonomies and Agencies not showing in translation (permalink error)

Solution:
Errata: https://wpml.org/errata/realhomes-conflict-with-easy-real-estate-plugins-property-status-slug-translation/

Relevant Documentation:

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.

This topic contains 28 replies, has 2 voices.

Last updated by Waqas Bin Hasan 1 year, 10 months ago.

Assisted by: Waqas Bin Hasan.

Author Posts
August 7, 2023 at 8:00 am #14161697

Waqas Bin Hasan
WPML Supporter since 05/2014

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Thank you for the updates.

Can you please remove those permissions things and temporary logins from the sandbox? Set user demo a password and let me know. We need this site unrestricted so we can check things in detail.

The site is meant to reproduce the issue afresh, while looks like you just exported everything and imported in here.

Anyways, please remove all restrictions so I can add/edit users normally. I am afraid if I delete that temporary login plugin, we'll lose the access.

I've set your next reply to provide with the new credentials to the sandbox.

August 7, 2023 at 1:01 pm #14163909

Waqas Bin Hasan
WPML Supporter since 05/2014

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Thank you for the updates. I am working on it and 'll get back to you accordingly.

August 8, 2023 at 9:33 am #14167961

Waqas Bin Hasan
WPML Supporter since 05/2014

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Thank you for your patience and cooperation.

I've escalated the issue to our 2nd tier team for a detailed investigation. I'll update you as soon as there's some progress.

August 8, 2023 at 11:08 am #14168775

Waqas Bin Hasan
WPML Supporter since 05/2014

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Thank you for your patience.

Team checked in sandbox and recommends turning on "Translate custom post and taxonomy base slugs (via WPML String Translation)" in WPML -> Settings -> Slug translations and save.

If it is already turned on, please just save and then resave permalinks.

We've checked in sandbox and it seems to work fine. You may need to try this on your site. Also remember to clear caches and force reload the pages you visit to check.

Please let me know.

Screenshot 2023-08-08 160614.jpg
August 8, 2023 at 2:57 pm #14170263

Gilbert

Good evening Waqas,
Thank you for your help.
I noticed that on the sandbox they litteraly removed all the plugins and even the theme, so I fail to see how they can say that it is working???
As soon as I reactivated the bare minimum (the theme and Elementor) we were back to the same error.

The slug option was enabled and I refreshed by saving it, but the same error still happen.
You can log to the main live website with the same credentials as the sandbox, I just updated your user.
Please let me know if this worked and if you were able to find the solution.
Thank you

August 9, 2023 at 9:35 am #14174457

Waqas Bin Hasan
WPML Supporter since 05/2014

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Thank you for the updates.

Actually while I was checking I came to narrow down it to default theme and a very few plugins. That I was able to reproduce the issue with default Footer language switcher of WPML. And then I needed to create a package for 2nd tier and I had to remove images, plugins and themes due to size going 2GB+.

In short, previously I had the impression it is coming directly from WPML, but now I noticed (as you mentioned) it is pointing somewhere to either theme or the elementor.

Thanks again for adding the theme and elementor. I can see the issue in sandbox.

I've also added "Download Plugins and Themes from Dashboard" plugin (not activate) in your live site. I'll use it if I need to take a plugin or theme from your site for the sandbox. I won't change anything in live site.

I am working on it to find more details and 'll consult with the team again. I'll update you soon on this.

August 9, 2023 at 2:05 pm #14176509

Waqas Bin Hasan
WPML Supporter since 05/2014

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Thank you for your patience and cooperation.

I and our 2nd tier team tested this thoroughly and the issue seems some confusing and complex. Like even the what we made to work, stopped working randomly.

So I'll escalate this to our compatibility team and 'll keep you posted accordingly.

August 10, 2023 at 6:40 am #14179283

Waqas Bin Hasan
WPML Supporter since 05/2014

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Thank you for your cooperation. The issue has been escalated to the compatibility team. I'll keep you posted about the progress.

August 15, 2023 at 6:32 am #14201305

Waqas Bin Hasan
WPML Supporter since 05/2014

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Thank you for your patience and cooperation.

Team did some digging and found that there's a conflict with the "property-status" string from the "easy-real-estate" textdomain in the plugin's code.

To fix this please use the following workaround:

IMPORTANT: Take full backup of your website and database beforehand.

1) Open the wp-content\plugins\easy-real-estate\includes\custom-post-types\property.php file.
2) Replace the ere_set_property_status_slug() function (line #316..323 approx - as shown highlighted in the attached screenshot):

function ere_set_property_status_slug( $existing_slug ) {

		$new_slug = get_option( 'inspiry_property_status_slug' );
		if ( ! empty( $new_slug ) ) {
			return $new_slug;
		}

		return $existing_slug;
	}

3) With:

function ere_set_property_status_slug( $existing_slug ) {

		// WPML Workaround for compsupp-6912
		if (class_exists('Sitepress')) {
			$existing_slug = 'property-status';
		}

		$new_slug = get_option( 'inspiry_property_status_slug' );
		if ( ! empty( $new_slug ) ) {
			return $new_slug;
		}

		return $existing_slug;
	}

4) Save the file.
5) Go to WPML > Settings > Taxonomy Translation.
6) Click on "Set different slugs in different languages for Property Statuses" and translate the slug.
7) Re-save permalinks.
8) Clear all caches and recheck.

Unfortunately the sandbox has been expired and I can not confirm it in there beforehand. So please apply these steps in your site and let me know if this works for you?

code.jpg
August 15, 2023 at 2:13 pm #14203637

Gilbert

Hello Waqas,
Thank you for the extensive work that you have done for us.
I applied the fix that you suiggested to the letter and it seems to have fixed the page of "property status".
But we still have a very strange issue. Once on thsi page, if you click on any property, the initial URL seems correct but then we get a 404 and the /fr/ in the URL seems to disappear.
I attached screenshots for you.

This is also happening for the "about us" page which is the "agency" in the template.

By the way, you have Admin access to our Live website if you wish to connect.
We did yet another full backup just in case.

Please let me know what you think.
Thanks again

No FR in URL.png
August 16, 2023 at 10:10 am #14208341

Waqas Bin Hasan
WPML Supporter since 05/2014

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Thank you for the updates.

I've checked and can see the problem. But the problem is random and weird. For example:

- Go to hidden link or hidden link and switch to French.
- On French page, mouse hover a property title and notice it gives the URL, i.e. hidden link
- If you click this it takes you (sometimes) to the correct URL (i.e. hidden link)
--- But if you refresh or reload, it takes you hidden link (404 not found)
--- Strangely, if you just add /fr/ to the URL again i.e. hidden link it brings back the correct one.

And sometimes it even stays at the correct URL.

I am not sure either something from the theme or the said plugin is in play or is it cache or server. I've tried clearing caches as well.

However, I'm discussing this with the team and 'll get back to you accordingly.

August 16, 2023 at 3:10 pm #14239031

Waqas Bin Hasan
WPML Supporter since 05/2014

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Thank you for your patience and cooperation.

Team suggested the followings, which I've applied in your site and seems to work fine now:

This is the same issue, but related to the property post type.

Workaround:
- Go to "Easy Real Estate > Settings > URL Slugs"
- Click on "Save"
- Re-save permalinks

Further notes:

This will load the string from database instead of using the translatable string, which should fix the issue.

Then, if you need to translate the slug, please do that on WPML > Settings > Post Type Translation. Don't translate the admin strings related to the slugs.

Please check and let me know.

August 17, 2023 at 1:29 am #14241757

Gilbert

Good morning Waqas,
Thank you once more for everything. At last things seem to be working correctly.

We still have two final issues and we are all set 🙂

1) On the homepage, the header is a "property slider" from the theme, and strangely enough, it's not showing in the French version.

2) On a property page, the "Additional Fields" are not showing. (see screenshots)

Promise, these are the last things :))
Thanks again

Additional Fields.png
Additional Fields Front.png
August 17, 2023 at 1:13 pm #14246541

Waqas Bin Hasan
WPML Supporter since 05/2014

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Thank you for confirming and glad that we were able to fix the original problem.

For other issues, I recommend opening a separate ticket because as per forum policy we can only handle one issue per ticket. So you can get more to the point help, without mixing up several issues in one long ticket.

Please feel free to close this ticket as resolved.

Best regards 🙂

August 17, 2023 at 2:17 pm #14246959

Gilbert

I will open another ticket for the remaining couple of issues. Thank you