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:
While enabling Language switcher in menu with Brooklyn Theme, Language switcher link missing href attributes.

Solution:
We are working with author to fix this issue. Meanwhile please go to themes\brooklyn\inc\ut-menu-walker.php line number 405 and replace this line

if( $blog_page_id == $item->object_id || $item->menutype == 'page' && $item->title != 'Home') {

with

if( $blog_page_id == $item->object_id || ( isset($item->menutype) && $item->menutype == 'page' ) && $item->title != 'Home') {

and in the same file line number 457

$attributes .= ! empty( $slug ) ? ' href="' . $blog_url . '/#section-' . esc_attr( $slug ) .'"' : '';

with

$attributes .= ! empty( $slug ) ? ' href="' . $blog_url . '/#section-' . esc_attr( $slug ) .'"' : ' href="' . $item->url . '"';

NOTE: If you are using one page theme then please make changes in file ut-menu-walker-onepage.php

This topic contains 13 replies, has 5 voices.

Last updated by boudewijnR 2 years, 10 months ago.

Assigned support staff: Sumit.

Author Posts
December 5, 2016 at 4:24 pm #1151791

yannickS-3

Dear Support-Team,

I run in a really seriouse issue after updating WPML to version 3.6.1.

After the update the language-switcher in the mainmenu isn´t longer working.
The flags appear correctly and there are no overlapping elements or other CSS mistakes.
The flags are just missing the "href"-attribute on the <a>-tag.

<li class="menu-item wpml-ls-slot-main wpml-ls-item wpml-ls-item-de wpml-ls-menu-item wpml-ls-first-item wpml-ls-last-item "><a class=""><img class="wpml-ls-flag" src="<em><u>hidden link</u></em>" alt="de" title="Deutsch"></a></li>

The problems appear on each flag – germand and englisch. If I enable the flags in the footer the flags in the footer are working well and as excepted.

Settings are not changed by us after updating and no other changes are made on the side. Just the update to WPML 3.6.1.

Any help is appreciated.

Kind regards
Nick

December 6, 2016 at 4:15 am #1152144

Shekhar Bhandari
Supporter

Languages: English (English )

Timezone: Asia/Kathmandu (GMT+05:45)

Hi there,

Thank you for contacting WPML support.

To debug this issue quickly, I need to request temporary access (wp-admin and FTP) to your site in order to be of better help. You will find the needed fields for this below the comment area when you log in to leave your next reply. hidden link

This info is private and available to you and supporters only. Read more about this: https://wpml.org/purchase/support-policy/privacy-and-security-when-providing-debug-information-for-support/

Note that:
+ Backup (both files and database) your site before giving us your credentials
+ It would be better if you give me the test site rather than the live site.

We'd like to request the permission to disable, enable and install themes and plugins for this site. Please accept this?

I look forward to your reply.

Thanks

December 6, 2016 at 7:59 am #1152244

Shekhar Bhandari
Supporter

Languages: English (English )

Timezone: Asia/Kathmandu (GMT+05:45)

It seems like a compatibility issue for me, If you disable all non-related WPML plugins, switch to one of default themes, the problem persists or not?
NOTE:
+ Make a backup (both files and database) for your site before updating/proceeding anything (Always a good practice!).

Additionally, would you mind sending me the theme files, so I can test the settings? You can upload those files on google drive and share the links with me, you can edit your previous private reply and share the link with me.

December 6, 2016 at 8:06 am #1152253

yannickS-3

Hello Shekhar,

if the "Brooklyn" theme is disabled the flags working.
You have full access, so I don´t need to send any files, feel free to try it by yourself.

Kind regards
Yannick

December 6, 2016 at 9:22 am #1152342

Shekhar Bhandari
Supporter

Languages: English (English )

Timezone: Asia/Kathmandu (GMT+05:45)

I am debugging this issue and will get back to you soon.

December 7, 2016 at 2:47 am #1153227

Shekhar Bhandari
Supporter

Languages: English (English )

Timezone: Asia/Kathmandu (GMT+05:45)

Ok, as far as I can see while enabling a menu in the theme we get a error message which is blocking the menu to get the href links, you can also see this error message by enabling wp_debug to true on wp-config.php file, I am discussing further on this issue with our 2nd tier supporters and will get back to you soon.

Thanks

December 7, 2016 at 8:12 am #1153361

Shekhar Bhandari
Supporter

Languages: English (English )

Timezone: Asia/Kathmandu (GMT+05:45)

I can confirm this is an compatibility issue.

I have forward the details to our Themes & Plugins Compatibility Team and they will contact the author.
Please note that this process may take a while as it depends on how soon the author will reply to our efforts to contact him.

It would be great if you can also contact the author asking him to reply us. You could also refer them to our Go Global program so that we can help them make their theme compatible with WPML. https://wpml.org/documentation/theme-compatibility/go-global-program/ This may help expedite the process.

We are closing the ticket but we will keep it in our records. You will be notified the moment we have the author’s cooperation in this process.

December 15, 2016 at 1:42 pm #1161209

Sumit
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hi,

I am Sumit from 2nd tier support.

We've identified the issue and working with the author to fix this. For now as a workaround please go to file \themes\brooklyn\inc\ut-menu-walker.php line number 405 and replace this line

if( $blog_page_id == $item->object_id || $item->menutype == 'page' && $item->title != 'Home') {

with

if( $blog_page_id == $item->object_id || ( isset($item->menutype) && $item->menutype == 'page' ) && $item->title != 'Home') {

Please share your feedback or let me know if you want me to do these changes!

Thanks

December 15, 2016 at 4:34 pm #1161416

yannickS-3

Hey Sumit,

I can not confirm that this solve the issue.
The problem still exists after changing.

No cache-plugin installed. Browser cache cleared.

Kind regards
Yannick

December 15, 2016 at 9:47 pm #1161672

Fabrice Mafille

Hi everyone,

Same problem for me :

https://wpml.org/forums/topic/language-switcher-english-francais-links-to-switch-on-main-menu-doesnt-work/

The files is for me ut-menu-walker-onepage.php

It's depend if it's a "one page" or "multisite" Brooklyn theme configuration i suppose

So, I have try the fix but it's not solve the issue.

December 16, 2016 at 10:55 am #1162083

Sumit
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hi, everyone!

I am sorry. Somehow I missed that and fixed warning that I was seeing.
Please do one more change in the same file. Please go to \themes\brooklyn\inc\ut-menu-walker.php line number 457 it is

$attributes .= ! empty( $slug ) ? ' href="' . $blog_url . '/#section-' . esc_attr( $slug ) .'"' : '';

Change it to

$attributes .= ! empty( $slug ) ? ' href="' . $blog_url . '/#section-' . esc_attr( $slug ) .'"' : ' href="' . $item->url . '"';

I've tested and it seems to me working on my site. Please share your feedback!

Thanks

December 16, 2016 at 1:46 pm #1162286

Fabrice Mafille

That's work perfectly for me : hidden link

Thank you very much !!!

Note : My Brooklyn theme is set as "one page theme" the file where I do the changes is ut-menu-walker-onepage.php

December 17, 2016 at 11:14 am #1162821

yannickS-3

Also works for me, thanks.

The fix must be – as Fabrice already said – applied to "ut-menu-walker-onepage.php".

January 12, 2017 at 10:45 am #1180464

boudewijnR

Hello, as a true layman I don't see how to get to "file \themes\brooklyn\inc\ut-menu-walker.php"

Could someone maybe tell me where to find that option?