Plugin Author
Chouby
(@chouby)
Hi!
Does your theme support a multilingual plugin (WPML or Polylang)?
Thread Starter
Seb81
(@seb81)
Hello Chouby,
yes it is claimed as fully translatable with WPML, and until recently it was almost ok : It’s the ‘adapt’ theme (premium version) from wpexplorer, so ‘almost’ means excepted a few strings (custom headers)from Option Framework incorporated to the theme. That issue was already discussed here : http://wordpress.org/support/topic/polyland-and-latest-pytheas-theme?replies=27 but nothing more. As the theme admin displays a ‘Slightly Modified Options Framework 1.5.2’ I guess the hand update to smof 1.6 would correct that too… (I discuss the issue with the creator of the theme, he said he would soon move all his theme to ‘theme customizer’ anyway, for anybody’s information)
But I don’t think my specific issue is related (which as no value as a clue). Plus : excepted if I always has been lucky while checking the website along two months, I really think it was working perfectly until recently.. which gives the bad feeling that something degenerated along time.
To describe the issue as simply as possible, the custom post type is made of ‘title’ ‘content’ ‘URL’ (slug too of course), and while title or content are independant for the two languages, URL value became unique, or synchronized, between translations.
it looks like that : http://studio.neq3.com/imageshare
Thread Starter
Seb81
(@seb81)
Update, I noticed that even ‘slides’ custom type , having an URL option to get anywhere clicking on the image get same behaviour now…
And that was definitly working for last months
Help help, website falling into pieces at worst moment.
What can make the ‘bridge’ between custom value from 2 different posts ??
Excepted the custom field synchro I cannot figure any reason :/
Would there be a way to hard-desactivate any fields replication over translation, I’d rather write down everything by hand in both posts for now rather than suppressing main interest to translation aka having different content.
Thread Starter
Seb81
(@seb81)
Update, I finally made my way through MySQL .. never seen it before
There I finally spotted the records of those URL and they become similar between post translation as soon as I save one of them.. so it’s really at the ‘update’ click process that a function manage to replicate where it should not be.
That’s all where I could reach till now.
Anybody has a wordpress function debug process tutorial to recommend ?
For noob please ๐
Plugin Author
Chouby
(@chouby)
Could you tell me where the “badly synchronized information” is stored?
To answer your other question on debugging, you can put this in your wp-config.php:
define('WP_DEBUG', true);
define('SCRIPT_DEBUG', true);
define('WP_DEBUG_LOG', true);
define('WP_DEBUG_DISPLAY', false);
This will log all errors and warnings in wp-content/debug.log
You can then use error_log function to log strings. You can for example log the content of an array with:
error_log(print_r($my_array, true));
Thread Starter
Seb81
(@seb81)
All fields containing the replicated URL appear in xxx_postmeta table
Here is the phpMyAdmin screenshot (custom-post-problem-SQL view.png) :
http://studio.neq3.com/imageshare/
Please note that :
– wpex_highlights_url appears only for both translation of one highlight post only, as I blanked the field in WP admin to stop redirecting visitors to wrong language URL for now. I just put back a value in one post translation so it appears in postmeta table (they was otherwise no entry in the table about that meta key).
– wpex_slides_url have correct metavalue right now, as I edited them straight in phpMyAdmin as a quick fix. They would otherwise behave as wpex_highlights_url and be similar by pair of translation. So they will return to, if I had to ‘update’ any their content thru wp admin.
________________________
What I really cannot get is why title/content/… could have correct treatment from pll, while those two dumb URL fields became mad…
I mean .. is there any common reason that makes a custom post field not being caught by translation differentiation engine, specially while the container is being translated ? I could start there I guess..
I started to believe that there might have been a silent update of the theme (is it possible?) because polylang seems, as far as I noticed along reading around, pretty robust now within properly developped themes.
Thanks for debugging infos !! I guess I will need little time to find a proper usefull $my_array value as I’m really not into wp core, don’t even talk about your amazing plugin : its presence in sql denotes a beautifull piece of abstraction ahah
Back to diggin’
Thank for all again,
peace
Plugin Author
Chouby
(@chouby)
I know that you already mentionned it in your first post. But are you sure that the synchronization option is de-activated for custom fields?
Otherwise, we will have to look if your theme dis not activate this synchronization (that’s possible to do programatically, even when the option is unchecked). Does your theme provide a wpml-config.xml file?
Thread Starter
Seb81
(@seb81)
Bam, you find it !
Yes there’s a wpml-config.xml,
and f**k! yes it includes lines like :
<custom-field action=”copy“>wpex_slides_url</custom-field>
<custom-field action=”copy“>wpex_highlights_url</custom-field>
Not sure what it does, but I guess “copy” looks like very involved in the problem, to say the least…
Although why would it starts to annoy me only now.. this wpml-config is there since ever. And I have a totally different one in wp_content/polylang/ that I created myself to try to translate the few custom strings in the theme (unsuccessfully). So polylang would check in BOTH theme folder and in wp_content/polylang for xml ? Or is it when I created the wp/polylang one that I ‘activated’ the one in the theme ?
Should I change it to “translate” instead of “copy” ?
(seems obvious but don’t want to crash everything)
More funny question just popping out RIGHT NOW.. should I update to wp 4.0 in regard to polylang or better wait for an update ??
happy new WearP all !
And thanks Chouby for the head up related to the xml !!
Plugin Author
Chouby
(@chouby)
Yes the “copy” means that Polylang will sysnchronize the custom field. Here is how Polylang acts depending on the keywords used (I got information from a WPML user before coding this).
// copy => copy and synchronize
// translate => copy but don't synchronize
// ignore => don't copy
So far, I did not notice any issue with WP 4.0
Thread Starter
Seb81
(@seb81)
Ah thanks … now I understand as well a behaviour that I always found strange, related to the fact that translate does copy at first but does not synchronize afterward.. super handy feature !!
So again thanks a lot Chouby,
and congrats for a plugin which is gonna let its stone in WP history imho !
Thread Starter
Seb81
(@seb81)
topic resolved by the way !
A few lines for search engines :
polylang may synchronize synchronization custom fields despite user options setting if wpml-config.xml wpml-config xml force copy over translate.
Thread Starter
Seb81
(@seb81)
By the way I think you should write down a note/warning about wpml-config.xml authority over user settings in the “synchronization over meta content” doc : http://polylang.wordpress.com/documentation/setting-up-a-wordpress-multilingual-site-with-polylang/synchronization-of-meta-content/
Might protect you from people like me ๐
Plugin Author
Chouby
(@chouby)
You are right. I updated the documentation ๐