September 1, 2012 at 10:23 am #15868
Hi Support team!
I have found a bug with translating Portfolio Meta Fields, so portfolio meta names(Skills, Project url, etc.) are not updated to the current language. It only happens with AJAX portfolio mode, in usual portfolio item page all portfolio meta names are taken as they should with corresponding language.
To see the problem, you have to enable two languages with wpml and write different portfolio meta names in each language. Depending from which ADMIN language you will save, portfolio meta names will be the same on both languages in the frontend, and second language will be ignored.
For example: I have translated different portfolio meta names (Skills, Project url, etc.) for each language, but if my admin panel is english and I save some changes, both languages will show english portfolio meta names(Skills, Project url, etc.). Same thing happens if my admin panel is russian and I save some changes, both languages will show russian portfolio meta names.
I think this problem lays not in the WPML plugin functionality(as I said in the usual portfolio item page it is ok), just AJAX should be updated somehow.
AleksandrSeptember 4, 2012 at 1:38 pm #89298
Can you check the AJAX request has the lang variable in the URL?
DavidSeptember 4, 2012 at 2:53 pm #89299
I’m not so good in PHP and AJAX, can you please point me or any support member, where is that URL that I need to alert to see.
I think it is somewhere here: http://nuforms.com/wp-content/themes/choices/js/avia.js under // Avia AJAX Portfolio
Also I found in functions-choices.php function that outputs Portfolio meta fields:
//function to retrieve the additional portfolio options
function avia_portfolio_meta($id = false, $portfolio_keys = false)
if(!$id) $id = get_the_ID();
if(!$id) return false;
$output = "";
$metas = avia_post_meta($id);
if(!$portfolio_keys) $portfolio_keys = avia_get_option('portfolio-meta', array(array('meta'=>'Skills Needed'), array('meta'=>'Client'), array('meta'=>'Project URL')));
$p_metas = array();
foreach($metas as $key =>$meta)
if(strpos($key,'portfolio-meta-') !== false)
$newkey = str_replace("portfolio-meta-","",$key);
$p_metas[$newkey-1] = $meta;
$counter = 0;
foreach($portfolio_keys as $key)
$linktext = $p_metas[$counter];
if(strlen($linktext) > 50) $linktext = __('Link','avia_framework');
$p_metas[$counter] = "<a href='".$p_metas[$counter]."'>".$linktext."</a>";
$output .= "<li><strong class='portfolio-meta-key'>".$key['meta'].":</strong> <div class='portfolio-meta-value'>".$p_metas[$counter]."</div></li>";
if($output) $output = "<ul class='portfolio-meta-list'>".$output."</ul>";
Tell me if I’m wrong, since php function outputs correct Portfolio meta fields on usual pages, I think the problem in avia.js file with AJAX function..
Hope for help frm support team, because it’s a template problem, imho, and big thanks to WPML support!
AleksandrSeptember 9, 2012 at 3:23 am #89300
I’m tagging this for Kriesi as well as the other support team members to read.
MyaSeptember 11, 2012 at 1:35 am #89301
Thanks for finding this, but as I don’t have the plugin, I am not sure what I can do to help you. But the way you were taking care of the previous issues, I think you can rightfully add wpml customization to your skill set.
NickSeptember 11, 2012 at 7:03 am #89302
Thanks for reply.
As I said, it’s not a wpml plugin problem, I think it’s an AJAX wrong url request. Please let Kriesi check this bug, since it’s a framework issue that will happen on other templates too.
Unfortunately my skill set lays more on graphic design, not programming )
Waiting to hear good news in solving this.
AleksandrSeptember 11, 2012 at 3:02 pm #89303
This is on Kriesi’s queue when he gets back into theme updates and bug fixes. I believe he is right in the middle of, or finishing up a personal project so he is in his mid project bubble. We are all flagged on the topic though and I’ll try and work through what you’ve found this evening after working today and maybe speed things up a bit :)
DevinSeptember 13, 2012 at 10:29 am #89304
Thanks for replies.
Also I want that you put attention to bug, that “Read more” text with <more> tag in the AJAX portfolio CAN’T be translated.
AleksandrSeptember 13, 2012 at 12:27 pm #89305
You can translate that manually, you can open functions-choices.php and find this code
the_content(__('Read more','avia_framework').'<span class="more-link-arrow"> →</span>');
IsmaelSeptember 13, 2012 at 7:50 pm #89306
Thanks for tip, I know about that function, but my site is on two languages and Read more translated in .po .mo files. Translation works fine everywhere on the site exept AJAX portfolio, so probably it is the same issue with similar roots as described in the first post.
AleksandrSeptember 17, 2012 at 5:17 pm #89307
I believe you are correct. I do apologize for the delay but Kriesi tends to get to his Queue at the end of the month so it may be a bit more of a delay before we are able to have him take a look at the issue.
DevinSeptember 30, 2012 at 7:57 am #89308
I tried to replicate what you are describing but was unable to. Everything worked correctly. Perhaps I misunderstood the problem. The only difference was that I used Latin letters and not Cyrillic to imitate Russian, take a look at the two versions below.
I also had this checked on the bottom of portfolio item page -> http://i.imgur.com/CN5rz.png
I added the words English and Russian to both the label and the value in the portfolio item page myself to differentiate between the two language versions.
English Front: http://i.imgur.com/O1e0q.png
English Back: http://i.imgur.com/kiAgs.png
Russian Front: http://i.imgur.com/P7b5b.png
Russian Back: http://i.imgur.com/PgLD3.png
NickSeptember 30, 2012 at 5:06 pm #89309
Thanks for your investigation, but if you read my problem with more attention you can notice that I have wrote that it’s correctly works with usual pages, as your example screenshots show! You showed usual page with your screenshots, NOT AJAX (direct breadcrumb link to portfolio item shows that).
The problem appears ONLY with AJAX portfolio, which also the topic name tells..
From you configuration that you have, please check portfolio meta names in AJAX mode.
AleksandrOctober 1, 2012 at 6:39 pm #89310
I see what you mean. http://i.imgur.com/EB15s.png Are you getting the Notice I have the arrow pointing at? Are you by any chance using an object-cache.php (drop-in file which would be sitting outside the plugins folder in wp-content directory)?
FYI: This thread discusses the same problem with categories (unknown theme) but final solution never posted. You may want to contact the support person and ask them how the problem was solved -> http://wpml.org/forums/topic/categorie-issue/ .. this also looks somewhat similar … http://wpml.org/forums/topic/duplicate-post-function-for-a-custom-post-type-generates-invalid-meta-data/
NickOctober 2, 2012 at 7:54 am #89311
Thanks for the links. I haven’t got any notice(maybe because of debug mode is off), but you see that portfolio meta names are not correct as I described.
Just want ot tell you, I’m not so good in PHP and AJAX to solve those kind of issues, I just want to make ALL Kriesi’s themes better, since it’s a common issue to all themes and frameworks. Can you be so kind to apply this fix or arrange it with WPML team, so people can download great Kriesi’s themes without this kind of bugs.
AleksandrOctober 2, 2012 at 1:13 pm #89312October 2, 2012 at 2:06 pm #89313
I still have a hope that Kriesi could look at this problem.
I haven’t got any notice, but problem persists ..
As I told you, I have not so much knowledge about PHP and AJAX to fix that and as a customer I did all thing that I could to help solve this bug and make template work as described in documentation.
Waiting for good news from support!
AleksandrOctober 2, 2012 at 2:26 pm #89314
Doing my best. This is not a major issue since it can be easily taken care of with a custom metabox till Kriesi works his magic. Hang in there, I will test a few more things as I don’t give up easily.
NickOctober 13, 2012 at 7:56 pm #89315
Ok, well after trying everything under the sun I got it working.
That’s the good news. The bad news is, I am not 100% certain how I got it working. No, I am not a moron. Well you can be the judge of that. Here is what I’ve done:
1) I deleted wordpress except for the wp-config file and wp-content directory & I deleted the Choices theme folder. I copied a new wordpress and theme, and in the old config file I just changed the $table_prefix = ‘wp2_’. and I added define(‘ALTERNATE_WP_CRON’, true);
3) I setup WPML first, including scanning for strings. I created and translated portfolio categories, then went to create and then translate the meta key fields (I first completely deleted the 3 place filler keys, not just overwrote them, as well as deleted the portfolio designations below the meta keys, first in english then in 2nd language.
4) I created the english dynamic template with only the portfolio item component first in english and then in 2nd language.
5) I created English and Spanish portfolio item pages (two for each language).
*6) At this point, I downloaded and installed the wpml_multilingual_compatibility_testing tool plugin from ( http://wpml.org/documentation/support/multilingual-compatibility-testing-tool/ ) and clicked on every test it offered.
7) I changed the 4 keys and 4 salts in the wp-congif.php file at this time. (I remembered something about changing wp_ but not deleting the database not being enough without changing salts and keys).
8) The last part, I made the Portfolio Page in English and the 2nd language and added the dynamic portfolio template to each.
So whether it was a clean install, adding wp_cron, the fact I didn’t use demo data, the fact I turned on the wpml plugins right after the theme or the use of the compatibility testing tool … The Portfolio Meta Data is working correctly with WPML.
NickOctober 15, 2012 at 8:03 am #89316
Thanks for such a big research!
I’ve got it working also!
AleksandrOctober 15, 2012 at 11:49 am #89317
The topic ‘AJAX Portfolio Meta Fields with WPML’ is closed to new replies.