Skip Navigation

[Resolved] Translated access control template is not working & shows 404 error page instead

This support ticket is created 2 years, 2 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

This topic contains 10 replies, has 3 voices.

Last updated by steffenM 2 years, 2 months ago.

Assisted by: Luo Yang.

Author
Posts
#2506073
Bildschirm­foto 2022-11-29 um 11.17.51.png
Bildschirm­foto 2022-11-29 um 11.18.35.png

Tell us what you are trying to do?
Hi, we have a customer site in German and English that is restricted to logged in users only. We use Toolset access control to restrict the page. German is our default language and we created a content template under Access Control in German which works fine while being on the german version of the site (hidden link). We also translated the template into english using WPML, but on the english version of the page we are getting a 404 error: hidden link

The website is created using Avada Theme and the login dialog you can see on the site is provided by Avada. The Register modal is done with Formidable Forms builder.

Is there any documentation that you are following?
Toolset documentation

Is there a similar example that we can see?
?

What is the link to your site?
hidden link

Could you please assist?

Thanks a lot,
Steffen

#2506171

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

I just ran a simple test on my local site where this appeared to work as expected.

I created a Content Template to be shown when access is restricted (just a heading with some text).

I translated that template to a second language.

I restricted Guest users from seeing pages using Access, and set them to be shown the above Content Template instead.

I ensured that my test page was translated into the second language.

I then tested it on the front end. A guest visitor in the default language sees the template content in the default language. Switching to the second language, they see the translated template content.

Those are effectively the same steps you have followed?

If so, I think we'll need to see you site to look into this further.

Let me mark your next reply as private so that we can get log-in credentials from you—you may want to create a temporary admin user for us to use that you can later delete. And be sure to have a current backup of your site.

#2506563

Hello,

I have checked it in your website:
1) You are using content template "No access", but it is empty in both languages:
hidden link
How do you display the login form in above content template?

2) Since you are using 30 plugins and a custom theme in your website, I have tried to switch to WordPress default theme 2023, but get below error in frontend:
There has been a critical error on this website.

In order to check the compatibility issues, Is there any way to deactivate plugins/theme in your website in order to check the compatibility issues

#2506683

Hi Luo Yang,

thanks for looking into this.

Yes, the content template is empty, because we don't need to show any content there. The homepage content is restricted using a restriction setting within the Avada Theme. The user login form also comes from Avada theme.

Switching from Avada theme to the default WordPress themes won't work and this is also not an option for us.

We can try to reproduce the issue on a blank test system. If you have any idea in the meantime, we would be happy to hear it.

Thanks,
Steffen

#2507065

Thanks for the details, I have tested it in my localhost, and I can reproduce the same problem, it seems the problem only occurs in the home page of secondary language, can you confirm it in your website? thanks

#2507245

Hi Luo Yang,

yes, exactly!

In the meantime we tested on a local system as well and could NOT reproduce the issue there.

On the customer project we found that we have reverse proxy via nginx activated. We see the following 404 errors:
2022-12-01 10:04:22 Error xx.xx.xxx.xxx 404 GET /en/ HTTP/1.0

On the customer server we have another website with WPML installed (but no Toolset is used there) and the switch to /en (for english) works well on this site. It uses FastCGI (Apache) instead. But even if we use the exact same settings on the affected site, we still get the 404.

How did you configure your local machine? nginx? Apache? Are we sure it's a Toolset issue and not an WPML issue?

Thanks,
Steffen

#2507705

Hi, I accidentially deleted the WP user I created for you.
Please provide me with an option again to send you new credentials.
Sorry and thanks!

#2507971

I am using Apache in my localhost, private message box enabled again

#2510249

Thanks for the details, I have escalated this thread, will update here if there is anything news.

#2511545

Here is the update from our 2nd tier supporters:
You can try below hot fix:
Download the patch file from here: https://toolset.com/patches/types-access-functions.php.zip
Unzip the file and use it to replace the file functions.php in Access plugin folder: plugins/types-access/application/

An important note: this update won’t be included in the upcoming Access release (too late), and so you will need to re-apply the patch after the next Access version.

#2511635

My issue is resolved now with the provided fix. Thank you!