Viewing 21 posts - 1 through 21 (of 21 total)
  • Author
    Posts
  • #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.

    Thanks,

    Aleksandr

    #89298

    Dear Aleksandr,

    Can you check the AJAX request has the lang variable in the URL?

    Best,

    David

    #89299

    Hi David,

    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
    if(!function_exists('avia_portfolio_meta'))
    {
    function avia_portfolio_meta($id = false, $portfolio_keys = false)
    {
    if(!$id) $id = get_the_ID();
    if(!$id) return false;
    if(post_password_required($id)) return;
    $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')));
    if(empty($metas)) return;

    $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)
    {
    if(!empty($p_metas[$counter]))
    {
    //convert urls
    if(avia_portfolio_url($p_metas[$counter]))
    {
    $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>";
    }
    $counter++;
    }
    if($output) $output = "<ul class='portfolio-meta-list'>".$output."</ul>";
    return $output;
    }
    }

    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!

    Thanks,

    Aleksandr

    #89300

    Hi,

    I’m tagging this for Kriesi as well as the other support team members to read.

    Regards,

    Mya

    #89301

    Hi,

    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.

    Thanks,

    Nick

    #89302

    Hi Nick,

    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.

    Thanks,

    Aleksandr

    #89303

    Hi Aleksandr,

    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 :)

    Regards,

    Devin

    #89304

    Hi there,

    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.

    BR,

    Aleksandr

    #89305

    Hi,

    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"> &rarr;</span>');

    Regards,

    Ismael

    #89306

    Hi Ismael,

    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.

    BR,

    Aleksandr

    #89307

    Hey Aleksandr,

    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.

    Regards,

    Devin

    #89308

    Hi,

    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

    Thanks,

    Nick

    #89309

    Hi Nick,

    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.

    Thanks,

    Aleksandr

    #89310

    Aleksandr,

    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/

    Thanks,

    Nick

    #89311

    Hi Nick,

    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.

    Thanks,

    Aleksandr

    #89312

    Hi,

    You’re welcome. Glad they helped.

    Thanks,

    Nick

    #89313

    Hi Nick,

    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!

    Thanks,

    Aleksandr

    #89314

    Aleksandr,

    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.

    Thanks,

    Nick

    #89315

    Hi,

    Ok, well after trying everything under the sun I got it working.

    https://docs.google.com/file/d/0B8hqGBMSfHtKaHBtSmtTeTJGX00/edit

    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);

    2) I activated the theme (no import of demo data), bbpress, and the 3 WPML plugins ( sitepress-multilingual-cms.2.6.0 , wpml-string-translation , wpml-translation-management ).

    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.

    Thanks,

    Nick

    #89316

    Hi Nick,

    Thanks for such a big research!

    I’ve got it working also!

    Good support!

    BR,

    Aleksandr

    #89317

    Hi Aleksandr,

    Glad that Nick helped you. :)

    Cheers,

    Ismael

Viewing 21 posts - 1 through 21 (of 21 total)

The topic ‘AJAX Portfolio Meta Fields with WPML’ is closed to new replies.