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 |
---|---|---|---|---|---|---|
- | 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: Europe/Madrid (GMT+01:00)
Tagged: Not WPML issue
This topic contains 8 replies, has 1 voice.
Last updated by Marcel 23 hours, 22 minutes ago.
Assisted by: Marcel.
Author | Posts |
---|---|
December 16, 2024 at 6:22 am #16515824 | |
barjD-2 |
Background of the issue: I have tested disabling all plugins except: However, the issue persists. The above-named WPML plugins are the only WPML plugins installed on the site. Symptoms: Questions: |
December 17, 2024 at 5:32 am #16519727 | |
Marcel Supporter
Languages: English (English ) German (Deutsch ) Timezone: Europe/Madrid (GMT+01:00) |
Hi, before your ticket is assigned to one of my colleagues, please allow me to walk you through some initial debugging steps. This will help speed up the support process. This happens because there is a fatal error on the site:
Please provide us the WordPress debug.log (not WPML debug informations). define('WP_DEBUG', true); define( 'WP_DEBUG_LOG', true ); In this case, the errors will be saved to a debug.log file located in the /wp-content/ directory. This will allow us to identify the exact error occurring. 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). Documentation: Best Regards, |
December 17, 2024 at 6:06 am #16519765 | |
barjD-2 |
Hello, for security reasons I can't use pastebin. Here is a link to the debug file hidden link Thank you for your reply and your help. |
December 17, 2024 at 7:16 am #16519872 | |
Marcel Supporter
Languages: English (English ) German (Deutsch ) Timezone: Europe/Madrid (GMT+01:00) |
Thanks! A Fatal Error has been logged from your theme. Please see the details below: [17-Dec-2024 05:17:23 UTC] PHP Fatal error: Uncaught ArgumentCountError: 52 arguments are required, 1 given in /nas/content/live/***/wp-content/themes/monochrome-pro/archive-trustee.php:83 Stack trace: #0 /nas/content/live/***/wp-content/themes/monochrome-pro/archive-trustee.php(83): printf('<a href="https:...') #1 /nas/content/live/***/wp-includes/class-wp-hook.php(324): sk_fields('') #2 /nas/content/live/***/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters(NULL, Array) #3 /nas/content/live/***/wp-includes/plugin.php(517): WP_Hook->do_action(Array) #4 /nas/content/live/***/wp-content/themes/genesis/lib/structure/loops.php(119): do_action('genesis_entry_c...') #5 /nas/content/live/***/wp-content/themes/genesis/lib/structure/loops.php(38): genesis_standard_loop() #6 /nas/content/live/***/wp-includes/class-wp-hook.php(324): genesis_do_loop('') #7 /nas/content/live/***/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters('', Array) #8 /nas/content/live/***/wp-includes/plugin.php(517): WP_Hook->do_action(Array) #9 /nas/content/live/***/wp-content/themes/genesis/lib/framework.php(66): do_action('genesis_loop') #10 /nas/content/live/***/wp-content/themes/monochrome-pro/archive-trustee.php(88): genesis() #11 /nas/content/live/***/wp-includes/template-loader.php(106): include('/nas/content/li...') #12 /nas/content/live/***/wp-blog-header.php(19): require_once('/nas/content/li...') #13 /nas/content/live/***/index.php(17): require('/nas/content/li...') #14 {main} The error originates from: The additional PHP notices are related to this known issue: WPML Errata: PHP Error in WP 6.7 - _load_textdomain_just_in_time Notice. Best Regards, |
December 17, 2024 at 7:46 pm #16523358 | |
barjD-2 |
Thank you for your reply. Could I ask, why does this template, named archive-trustee.php work perfectly in English but not in the translated language? It is indeed the code that controls the display of hidden link I also ran the file through a PHP syntax checker, and it came up with no errors. I am really confused by this 🙁 I have attached a screenshot so you can see line 83. Does anything stand out to you that would cause a WPML translation to not appear? Or if it is more helpful, the entire file's code is here hidden link Thank you again for your help. |
December 18, 2024 at 8:49 am #16524765 | |
Marcel Supporter
Languages: English (English ) German (Deutsch ) Timezone: Europe/Madrid (GMT+01:00) |
Hi, I can see the issue from the screenshot. The problem occurs because printf() requires a format string with placeholders (e.g., %s) and corresponding arguments. If a plain string without placeholders or arguments is passed, it triggers an ArgumentCountError, especially when WordPress translations (like WPML) modify the content. It looks like the link with the placeholder %s (set before line 82) may have been altered or broken in WPML → String Translation, which is causing the error. Please search for that string and ensure it includes %s inside the translation. Let me know if you need further assistance! Best regards, |
December 18, 2024 at 9:28 pm #16527815 | |
barjD-2 |
Thank you very much for your help, it is much appreciated. I have tried to search for the string with "%s" in it but when I enter "%s" in the search field by going to WPML > String Translation, and also select the domain of "genesis" or "monchrome-pro", it returns results for "all domains." There are over 4000 strings. None of the first results show strings with "%s" in them. However, since the "%s" is trying to create a hyperlink to the custom post type's single posts, I think it is looking for a specific link, no? Wouldn't those links automatically be synced in WPML? I have attached screenshots to show you what part of the English version it is trying to find, in case it sheds more light here. Since the text of the hyperlink is "See bio," I searched for "See bio" in the strings, and the English doesn't contain "%s". But I added "%s" to the Punjabi field as you can see in the attached screenshot. However, it did not solve the issue. Could you help direct us further in figuring out what string WPML is looking for, and where we need to add "%s"? Thank you very much again. |
December 19, 2024 at 12:37 pm #16530172 | |
Marcel Supporter
Languages: English (English ) German (Deutsch ) Timezone: Europe/Madrid (GMT+01:00) |
Hi, The link visible as "a href" in line 83. It comes from the sprintf function, not from the __() gettext call that loads "See bio": <a href="%s" class="more-link">%s</a> You can search for this link and use the "Exact Match" filter checkbox to locate it. Best regards, |
December 19, 2024 at 6:27 pm #16531481 | |
barjD-2 |
Thank you Marcel. I rescanned the themes just in case before searching. I have tried to search for "%s" using exact match and "a href" in String Translation but nothing comes up. If I go to the Admin texts screen to search, both terms brings up results but they are not related to this string. I did look through the 3 pages of results for "%s" under admin text for translation too. I have attached screenshots for you to see. Is there a specific phrase I should be searching for other than "a href" or "%s"? I may be away for a litte while but please don't close this ticket if you don't hear back from me right away. |
December 19, 2024 at 6:29 pm #16531538 | |
Marcel Supporter
Languages: English (English ) German (Deutsch ) Timezone: Europe/Madrid (GMT+01:00) |
Hi, if you select "Exact Match" you need to exactly search for "%s". "a href" alone is not a match otherwise. I would like to request temporary access (wp-admin and FTP) to your site to take a better look at the issue. It would be better to a testing site where the issue is replicated. You will find the needed fields for this below the comment area when you log in to leave your next reply. The information you will enter is private which means only you and I can see and have access to it. Maybe I'll need to replicate your site locally. For this, I’ll need to temporarily install a plugin called “Duplicator” or "All in One WP Migration" on your site. This will allow me to create a copy of your site and your content. Once the problem is resolved I will delete the local site. Let me know if this is ok with you. IMPORTANT Best Regards, |
December 20, 2024 at 12:08 pm #16533864 | |
Marcel Supporter
Languages: English (English ) German (Deutsch ) Timezone: Europe/Madrid (GMT+01:00) |
Hi, Thank you for providing access. I recreated the same entry identically, and it is displaying correctly here: hidden link. I found that the issue only occurs when the permalink for the translated listing uses Indian characters. For example, if you edit the permalink in this listing: hidden link">Edit Listing and change it from /test1/ to ਕੁਲਵਿੰਦਰ-ਸਿੰਘ-ਢਾਹਾਂ2, the issue appears. This indicates that the problem is not with the archive page itself, but with the included listing. It seems to be caused by how Unicode characters are handled in the theme’s code. You will need to contact your theme’s authors to address this, as it is likely a coding issue. Certain functions may not properly handle Unicode characters if they are not correctly encoded. The authors may need to implement a different approach. I tested the issue by encoding the permalink using esc_url() and rawurlencode() to handle Unicode characters, but the problem persists. This suggests the issue may be related to the server’s handling of Unicode or the database's character set/collation. Best Regards, |
January 5, 2025 at 10:23 pm #16564868 | |
barjD-2 |
Thank you for all your help with this. It was pointed out that the *single post* on the *translated* custom post type *archive* shows correctly if no Punjabi characters (unicode characters) are used in its slug. In other words, the "critical error" message of the single post on the archive page goes away when no Punjabi characters are used in the post's slug. This applies to the post listing itself in the query loop, not the design of the entire custom post type archive *template*, which remains broken. Previous screenshots show what is meant by this, if this explanation is confusing. As a test, I changed all the Punjabi translations of the individual posts to use English characters in their slugs. Then the custom post type archive page appeared correctly. If one of the posts uses Punjabi characters in its slug, then the *custom post type archive page* breaks. However, I feel this does not explain everything because the translations of other posts appear correctly when using Punjabi characters in their slugs. E.g. hidden link Why is it only the custom post type posts that can not use Punjabi characters in their slugs, to avoid this issue? And, why do Punjabi characters in the single post slugs cause the *custom post type archive page* to break, but not the single posts themselves? The 'break' only happens on the custom post type archive page when any of the single posts of that custom post type use Punjabi characters. All other pages of the entire site appear correctly when using Punjabi characters in the slugs (i.e. for pages and posts). Also, this issue does not happen on category archives of native WordPress posts when the posts use Punjabi characters in their slugs: hidden link Could our issue be related to the known issue described here: https://wpml.org/forums/topic/archive-custom-slug-translation/ ? We purposely did not add a translation under WPML > Settings > Post Types Translation > "Set different slugs in different languages for [custom post type name]" because we read that it a known issue with WPML that if we do set a translation in this field, it will cause a break. (See screenshot). We were not made aware that the *single posts* also could not not use translations. Given that it is a known WPML issue to not be able to translate custom post type slugs at the moment, and all other slugs of native posts can use Punjabi unicode characters, can you confirm that unicode characters in custom post type single post slugs is definitely not a WPML issue? Although its not completely understood, would this documentation be a solution for us? https://wpml.org/errata/incorrect-links-for-custom-post-types-and-taxonomies-sharing-the-same-slug/ Thank you very much for your help. |
January 7, 2025 at 8:12 am #16568268 | |
Marcel Supporter
Languages: English (English ) German (Deutsch ) Timezone: Europe/Madrid (GMT+01:00) |
Hi,
|
January 8, 2025 at 12:47 am #16571665 | |
barjD-2 |
Thank you again for all you're doing to help us find the root cause of the issue. It is appreciated. I copied the default code exactly as it is without changing anything. I pasted it at the bottom of the Twenty theme functions.php file in the sandbox site you set up for me. I went to create a new post in that custom post type, so that I could test the URLs with Punjabi characters in them. However, no editing box showed up at all for me to be able to do this. I also tried the same code on a test site of our own site, with our theme, and got the same result. So I went back to the default code creator (hidden link) and started adding options. This allowed me to add a post on the sandbox site. However, once I left the post editing screen, I could no longer see the post to be able to view its url or change its taxonomies or edit anything any further. I also could not add any translations (the translation of the custom post type archive is the only place where the break happens on our site). But when I created a new post and tried to view it by clicking the link on its editing screen, I reached a page that said "nothing here." I got the same message when trying to visit the archive page. I tried to re-save permalinks on the sandbox site, but it did not fix the issue. So I went back to default code creator again and made more customizations by entering names into the field boxes, this time creating a "Team Members" Custom post type. I added the "Team Members" Custom post type to the functions.php file of the sandbox site. I got the same results. I can not edit or re-view the posts that are created. I also get messages that say "nothing here" on the front end. No post has a translation option on it. As a final test, I added the "Team Member" custom post type code from the default code creator to our test site. I added a team member post and used Punjabi characters in the URL. After conducting other troubleshooting tests, I have narrowed down the issue to this part of our archive template (which was noted earlier): $loop .= sprintf( '<a href="%s" class="more-link">%s</a>', get_permalink(), __( 'See bio', 'genesis' ) ); printf($loop); If I take out one or both of those lines, the "Critical error" message goes away. However, the design of the template breaks in other ways (the posts change their size and lose formatting). I am wondering if anything in those lines stands out to you, which would make Punjabi characters not work well in the context of WPML translation post urls and the custom archive post template? It looks like that code is trying to get "%s", which is trying to get the URLs with Punjabi characters in them. It can't seem to do this without creating the "critical error" and breaking the page's appearance. In your expert opinion, if the above theory is true, do you think this is specific to this one template, or do you think the "%s" usually has a hard time in cases like this, with WPML translated posts? You did speak to the URL issue earlier. I'm curious if you know if this common with the use of "%s" trying to grab Punjabi characters? Is there another way to get the url of the posts that would not cause this issue? If it is something the host can help with, can you let me know how to word a question to them? I would be lost trying to explain all this to them. I added screenshots to this response to describe the issues noted above when trying to test the default code. Thank you again. |
January 8, 2025 at 8:23 am #16572318 | |
Marcel Supporter
Languages: English (English ) German (Deutsch ) Timezone: Europe/Madrid (GMT+01:00) |
Hi, thank you for your feedback! The issue is not with the sprintf() function itself or the placeholder variable – the problem lies with the URL that’s being delivered by that variable. As I mentioned earlier in the ticket:
So, the issue isn’t caused by the archive page directly, but rather by what’s being retrieved as the listing in that call.
There’s nothing unusual about using %s for URLs, even when they include Unicode characters like Punjabi. A typical WordPress theme should handle this without issues. That said, the way your theme processes the listing URLs is the core of the problem. Regarding your question about reaching out to your hosting provider — I don’t think your host can assist with this particular issue. Instead, I strongly recommend contacting the theme author, as the theme is a paid product. They should be able to provide more insight into how their code handles special characters and URLs. Lastly, please keep in mind that we’re limited in the support we can offer for issues caused by custom coding. The theme developer should be your best point of contact for this. Let me know if you need any further clarification! Best regards, |