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 thread is resolved. Here is a description of the problem and solution.

Problem:

The custom link menu item is missing the URL field when WPML Media is active with SG Optimizer and Fusion Builder

Solution:

Add the following snippet to the functions.php file of your theme.

add_action( 'wp_update_nav_menu_item', function( $menu, $item ) {
	wp_cache_set( $item, null, 'post_meta' );
}, 20, 2 );

But also be aware that this might not be needed anymore and the issue was fixed maybe from the SB side. The user writes here.

Before your snippet, I tested the issue again and could not reproduce it with all plugins activated.

Tagged: 

This topic contains 25 replies, has 2 voices.

Last updated by Kristof 1 month, 2 weeks ago.

Assigned support staff: Itamar.

Author Posts
July 29, 2019 at 9:39 am

Kristof

I am trying to: insert a custom link under Appearance > Menu

Link to a page where the issue can be seen: hidden link (Itinera Talks)

I expected to see: a href behind that link

Instead, I got: no href

When the WPML media plugin is active, after we add a Custom Link to the menu, the href is missing from the link. When we try to edit that Custom Link, we notice that the URL field is missing.

We have tested this in a minimal WP setup and all works well until we activate the WPML Media plugin

July 29, 2019 at 10:21 am
July 29, 2019 at 11:27 am #4299175

Itamar
Supporter

Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+03:00)

Hi.

To replicate this problem, I've created a test site with a clean WordPress install.
You can access it through this link:
hidden link
Through this link, you will be automatically logged in. (If nobody logs in the test site will be available for one week from today.)
I've installed the Avada theme and Fusion Core and Fusion Builder plugins, all with the latest versions. But I can not replicate this problem. When I add a custom menu item, the link remains when I save the menu and does not disappear as we can see on your site.
I think maybe there are other settings that I didn't set and which is set on your site.
Could you please access the test site and see if you can replicate the problem there?

If you can't replicate there, then we'll need to find the reason why it is happening on your site. You already mentioned that you tried the minimum environment.
Could you please make sure again that a third party plugin is not causing this problem?
Please deactivate all plugins, including any cache plugins like the SG Optimizer plugin. You should only leave active the Avada theme and the following plugins.
- WPML
- String Translation
- Translation Management
- Media Translation
- Fusion Core
- Fusion Builder

If you are still getting the same results, then please check for any PHP errors.
Please do the following:
Please provide me with the WordPress debug.log
Please check this page for instructions.
https://wpml.org/documentation/support/debugging-wpml/
Look under the headline "Enabling the built-in debugging feature in WordPress".
To enable it, open your wp-config.php file and look for define(‘WP_DEBUG’, false);.

Change it to:

define('WP_DEBUG', true);
// Enable Debug logging to the /wp-content/debug.log file
define('WP_DEBUG_LOG', true);
// Disable display of errors and warnings which is recommended on a live site.
define('WP_DEBUG_DISPLAY', false);
@ini_set('display_errors',0);

After enabling the debug log, create another custom menu item. In other words, repeat the process that caused the problem. Then errors will be saved to a debug.log log file inside the /wp-content/directory. If you can paste your debug.log to pastebin.com and provide me that link, it would be great! (This is the cleanest way because sometimes the logs are long and create a complete mess in discussion).

Please, could you provide me the additional Info?

Thanks,
Itamar.

July 29, 2019 at 11:31 am #4299185

Itamar
Supporter

Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+03:00)

Note: If you are going to try the minimum environment on your site, then please back up the site first.

**** Important! Please make a full site backup (files and DB) before you proceed with those steps****


*** If your site is a live site you might want first to try those procedures in a staging environment or a snapshot of your site on your local server or another server. ***

July 30, 2019 at 8:42 am #4305795

Kristof

Hi,
I could not replicate the issue on the demo site.
I activated your minimal setup and could not replicate the issue
I then activated all plugins again and the problem appeared again.
I then started deactivating plugins one by one and each time created a new Custom Link and it looks like the SG Optimizer plugin was the culprit.
I was able to replicate this on my live site.

there is only one identical entry in the debug.log

[30-Jul-2019 08:33:13 UTC] PHP Deprecated: Function create_function() is deprecated in /home/itinerainst/public_html/staging/wp-content/plugins/revslider/includes/framework/functions-wordpress.class.php on line 258

July 30, 2019 at 12:14 pm #4307589

Kristof

Update
I have installed the SG Optimizer plugin on your demo site but still cannot replicatie the issue.
Very strange because on my live and staging toggling the Siteground plugin really triggers the issue, just like WPML media did before.

July 30, 2019 at 5:10 pm #4309839

Itamar
Supporter

Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+03:00)

Thanks for testing this.

The PHP error does not seem related.

The SG Optimizer plugin is designed to work with Siteground servers which have special cache configurations. I'm not expecting it to work on our server and therefore the issue cannot be replicated there.

Do you have the option to create a test site for me on your Siteground server?
I'll need a clean WordPress installation on this site, and then I'll take it from there and see if I can replicate this issue. And if so, then I'll escalate this issue to our compatibility team, and if needed they will try to contact Siteground's people to cooperate on this issue.

I'm enabling a private message for the next reply.

Thanks,
Itamar.

July 30, 2019 at 7:11 pm
July 31, 2019 at 12:21 pm #4314253

Itamar
Supporter

Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+03:00)

Hi and thanks a lot for setting up the test site for me.

I cannot replicate this issue on the test site. When WPML Media and SG Optimizer are active there is no issue with the URL field of the custom menu item. But on your site, I can still see this issue. Only when WPML Media and SG Optimizer are active together the custom menu item URL field is missing.

I'm currently consulting our second tier supporters on how to proceed with this case. I'll get back to you here when I have an answer from them.

Thank you for your patience.
Itamar.

July 31, 2019 at 1:08 pm #4314649

Itamar
Supporter

Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+03:00)

Hi.

Our second tier supporter suggests that you first update all plugins and then check if the issue persists. When I look at the plugins section of your site, I can see that two plugins are not updated. The 'WP Staging Pro' and the 'WP-Optimize - Clean, Compress, Cache' plugins.
Can you please update them and see if the issue persists?

Thanks,
Itamar.

July 31, 2019 at 3:13 pm #4315865

Kristof

I updated WP Optimize, however I use the GPL version of WP Staging Pro and there is no update available at this moment so I deactivated the plugin. This is done on the live site. With all the plugins active and updated, the issue is still there.

July 31, 2019 at 4:51 pm #4316881

Itamar
Supporter

Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+03:00)

Thanks for trying this.

I must say that this, not an easy case to debug. But of course, we are still here and continue helping you. I'm not sure if have tried things in the following way.
Can you please check if the issue persists, when all the plugins are deactivated and only the following plugins are active?
- WPML Multilingual CMS
- Translation Management
- String Translation
- WPML media
- SG Optimizer

Thanks,
Itamar.

July 31, 2019 at 7:34 pm #4317377

Kristof

I do appreciate your effort!

I have activated the staging again with the plugins you listed and indeed, the issue is still there. HOWEVER, when we then switch to the Twenty Nineteen theme, the URL field for the Custom Link is visible. When we switch back to Avada parent theme, the URL is missing.

This is very strange as we were able to reproduce this issue with the 2019 Theme before.

Avada + SG Optimizer + 4 WPML plugins = issue
Twenty Nineteen + SG Optimizer + 4 WPML = ok
Avada + SG Optimizer + 3WPML - WPML media = ok

August 1, 2019 at 8:39 am #4319917

Itamar
Supporter

Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+03:00)

Thanks a lot for further checking this issue.

I'm going to send all this detailed information to our second tier supporter and ask him how to continue with this issue. I'll keep you updated here.

August 1, 2019 at 12:45 pm #4321901

Itamar
Supporter

Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+03:00)

Hi.

Our second tier supporter asks me to escalate this issue. For this, I need to have a copy of your site. Please allow me to install the Duplicator plugin (https://wordpress.org/plugins/duplicator/) on your site and create a copy of it.

I'm waiting for your confirmation.

Thanks,
Itamar.