Language problem with link in Email confirmation

This topic contains 11 replies, has 3 voices, and was last updated by  Marc Mathys 7 years, 1 month ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
  • Author
    Posts
  • #370046

    Marc Mathys
    Expired Member
    Post count: 216

    Hi,

    I noticed that the link in email confirmations is in the wrong language after a new listing is published.
    We just published this listing:
    https://www.arbolife.com/fr/restaurants/switzerland/neuchatel/saint-aubin-sauges/yummy-parenthese-gourmande/

    And the link in the email points to this link (missing the /fr/)
    https://www.arbolife.com/restaurants/switzerland/neuchatel/neuchatel/yummy-parenthese-gourmande/

    On another test I noticed that the CPT slug was also in the wrong language where the listing was in /fr/magasins/switzerland and the email pointed to /stores/switzerland.

    Could you please take a look ?

    Thanks,
    Marc

    #370047

    Marc Mathys
    Expired Member
    Post count: 216
    This reply has been marked as private.
    #370169

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    Hi Marc,

    Is everything upto date?
    I have flagged this for kiran to look at tomorrow.

    Thanks,

    Stiofan

    #370170

    Marc Mathys
    Expired Member
    Post count: 216

    Hi Stiofan,

    Yes, all plugins are up to date.

    I did switch the WPML default language from English to French and I did also force the usage of the /en/ directory in English which I didn’t use before. Those are the only changes I made recently, but I’m not 100% sure that it was working before those.

    Thanks,
    Marc

    #370279

    Kiran
    Moderator
    Post count: 7069

    Hi Marc,

    I have done some tests on your site, and seems it worked for me.
    1) In EN language added one Restaurant listing “GD Test EN” and in notification mail got link “https://www.arbolife.com/en/restaurants/switzerland/neuchatel/neuchatel/gd-test-en/”
    2) In FR language added one Restaurant listing “GD Test FR” and in notification mail got link “https://www.arbolife.com/fr/restaurants/switzerland/neuchatel/hauterive/gd-test-fr/”
    3) In FR language added one Store listing “GD Test FR” and in notification mail got link “https://www.arbolife.com/fr/magasins/switzerland/neuchatel/peseux/gd-test-fr/”

    In above all three listings i got correct links in email.

    Can you provide steps how to re-create from our end?

    FYI:
    After checking you can delete my listings which i created for test purpose.

    Thanks,
    Kiran

    #370282

    Marc Mathys
    Expired Member
    Post count: 216

    Hi Kiran,

    This is strange… I just created a store in French and got the wrong links in the email like described in this ticket. I forwarded the email to the GD Dev user’s email address for you to see.

    The URL points to:
    https://www.arbolife.com/stores/switzerland/neuchatel/neuchatel/test/

    which has the 2 issues of slug translation and missing language.

    Steps were:
    – in the back-end as admin
    – have French as the language
    – Stores -> add stores
    – enter name
    – pick a category
    – move the pin on the map
    – publish

    Best,
    Marc

    #370296

    Kiran
    Moderator
    Post count: 7069

    Hi Marc,

    I had tested it in front-end. 🙂

    In backend this happens due to ordering of listing save and applying language to saved listing. It happens only when you are going to create new listing from backend. The published email sent when listing get published, and that time listing has no language applied by WPML. This happens only for new listing, for existing listings this does not happened when listing moved from draft -> publish.

    To overcome this just create new listing with “draft” status (by clicking on Save Draft instead of Publish). Once listing saved as a draft, Publish it.

    Let us know.

    Thanks,
    Kiran

    #370366

    Marc Mathys
    Expired Member
    Post count: 216

    Hi Kiran,

    Thanks for the explanation. Not convenient, but I can live with that (since I have no choice anyhow).

    Best,
    Marc

    #370367

    Kiran
    Moderator
    Post count: 7069

    Thanks for letting us know 🙂

    #370371

    Marc Mathys
    Expired Member
    Post count: 216

    On second thought, I suspect something is not complete with your explanation.

    1. You say that the listing has no language applied, but the URL already knows the language before it is saved or published with the &lang=fr :
    https://www.arbolife.com/wp-admin/post-new.php?post_type=gd_place&lang=fr

    2. When I publish an event (Events Manager plugin) in French, the email confirmation contains the link to the correct French URL. How do they do it to detect the correct language?

    Any thoughts ?

    Best,
    Marc

    #370373

    Kiran
    Moderator
    Post count: 7069

    Hi

    1.
    < The listing url is retrieved by get_permalink() function https://developer.wordpress.org/reference/functions/get_permalink/.
    The listing url is build based on which language that post contains. Suppose post ID 567 is created in french then it will retrieve the listing url in french even you use get_parmalink( 567 ) in english language.
    In backend admin user has option to set their editing language whether in admin language as editing language or current viewing language.

    2.
    < Not sure how it detects language for event manager url. I can’t see this in my test site.

    Kiran

    #370398

    Marc Mathys
    Expired Member
    Post count: 216

    OK, thanks. We will live with it then.

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

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket