Skip Navigation

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.

Sun Mon Tue Wed Thu Fri Sat
- 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 -
- 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 -

Supporter timezone: Asia/Ho_Chi_Minh (GMT+07:00)

This topic contains 5 replies, has 2 voices.

Last updated by Long Nguyen 1 year ago.

Assisted by: Long Nguyen.

Author Posts
January 30, 2023 at 4:47 am #12918283

brianD-22

I'm using Toolset Access Control with CPTs to create "teaser" content that is readable by guests. My site is bilingual (English and Irish.) The site homepage(s) uses a "Homepage Visitors" Post Group with a "Welcome Content Pages" Content Template displayed for Guests without read permissions. In this case, the Language Switcher displays in the primary navigation menu as expected. See hidden link and hidden link.

Note: I'm following the documentation found at https://toolset.com/course-lesson/restricting-access-to-pages/.

Three CPT types are restricted to Guests but their archive pages remain visible. I've also placed a few instances of those CPTs (the "teaser content") in a Post Group called "Welcome Content" to which Guests have read access. Otherwise, CPTs not in the Post Group default to a Login template. Here are some examples of Welcome content that *is* accessible to Guests:

hidden link
hidden link
hidden link
hidden link

Note that translations exist for both the archives page as well as the accessible CPT content. However, the Language Switcher does not display. But, when a guest visits a similar restricted CPT page, the Language Switcher appears as desired:

hidden link hidden link

Here's another similar and more curious anomaly: The taxonomy page hidden link displays the Language Switcher pointed to hidden link, but the Irish version doesn't display the Language Switcher back to English.

I want the Language Switcher to appear wherever there is an accessible translation. I'm not sure if I'm doing something wrong here or if these cases may be related to a bug that was identified by Nigel about a week ago. See: https://toolset.com/forums/topic/access-control-post-group-alternate-template-not-working-for-translated-content/

Thanks in advance for any help you can provide.

January 30, 2023 at 8:05 am #12918927

Long Nguyen
Supporter

Languages: English (English )

Timezone: Asia/Ho_Chi_Minh (GMT+07:00)

Hi there,

Thank you for contacting WPML support, I'd be happy to help you with this issue.

Can you please let me know if the issue happens when using Toolset Access? If you deactivate this plugin, does the issue persist?

I've tried to replicate this issue on my demo site but do not see that issue. If the issue persists after deactivating Toolset Access, you can try to enable a minimal environment as below and see if it helps.
- Deactivate all plugins except WPML and Toolset
- Switch to a standard theme of WordPress
❌ IMPORTANT: Please backup your database and website before proceeding ❌
You can use this plugin to create the backup: 
https://wordpress.org/plugins/duplicator/

While checking the debug info, I see that the WordPress Memory Limit is below the requirements. The minimum requirements are 128M, but we do recommend 256M and the debug information of your site shows it set to 40M. Please check this link for more details https://wpml.org/home/minimum-requirements/.
You can increase it by adding the following code in your wp-config.php file, right before the /* That’s all, stop editing! Happy publishing. */ line:


define( 'WP_MAX_MEMORY_LIMIT', '256M' );
define( 'WP_MEMORY_LIMIT', '128M' );

After adding the code you can confirm that the memory was changed correctly from WPML > Support > WordPress > Memory limit.

If not, it could be a compatibility issue. Please install the Toolset Access plugin on the test site I'm providing here.
hidden link
With this link, you'll be directly logged in, and see if the issue is replicable on a clean WordPress installation. Please configure WPML, Toolset as they are configured on your site (just the basic configurations needed to replicate the issue are enough). Please also make sure that you are installing the latest version of the plugin. When everything is finished, and you can replicate the problem, please let me know.

Look forward to your reply.
Thanks

January 30, 2023 at 7:37 pm #12924413

brianD-22

Hello Long,

The issue is definitely related to Toolset Access. When I disable that plugin, the Language Switcher appears as expected. (See attached screen shot, which I captured while *not* logged in.) Also, when the Toolset Access plugin is activated, and when I log in, the Language Switcher displays for those pages as expected.

I also increased the Memory Limit per your suggestion. (Thank you!) However, that didn't have any visible effect.

Before I go and strip down my site or do a clean install in the sandbox you provided, does the fact that I can make the problem go away if I disable Toolset Access mean there's another debugging strategy for us to explore?

Thanks,
Brian Doyle

Screenshot 2023-01-30 1.30.17 PM.png
Screenshot 2023-01-30 1.22.44 PM.png
January 31, 2023 at 3:04 am #12925989

Long Nguyen
Supporter

Languages: English (English )

Timezone: Asia/Ho_Chi_Minh (GMT+07:00)

Hi,

Thank you for the feedback.

Yes, that means there could be a compatibility issue there and we don't know how this happens. If it is a real issue and can be replicable on the sandbox site, please help us to replicate it then I can escalate it to the development team to fix it as soon as possible.

Link to login to the sandbox site: hidden link

Look forward to your reply.
Thanks

February 2, 2023 at 1:12 pm #12947657

brianD-22

Long: Thanks again for the link to the sandbox. I've been doing some troubleshooting on my own. The behavior I'm seeing has something to do with the way that I configured my Post Group. I expect to resolve this on my own but need about another day to confirm. Can you keep this open for 1-2 days more in the meantime?

February 3, 2023 at 3:39 am #12952071

Long Nguyen
Supporter

Languages: English (English )

Timezone: Asia/Ho_Chi_Minh (GMT+07:00)

Hi,

Thank you for your feedback.

Yes, of course. Please take your time and you can reply to this ticket in a few days or you can create a new ticket whenever needed.

Have a good day.

The topic ‘[Closed] Language switcher not showing (sometimes)’ is closed to new replies.