Entering french characters in custom fields

This topic contains 9 replies, has 3 voices, and was last updated by  Stiofan O’Connor 10 years, 9 months ago.

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

Open Support Ticket
  • Author
    Posts
  • #12626

    TØm Babwá
    Buyer
    Post count: 42

    Hi there,

    I’m french and I work on a beer project with geo directory. I have to say the plugins are very awesone.

    However, there is some few problem with french character like “à”, “é”, “è” etc… Then, french people have often used this character.

    3 days ago, I got the same problem than Tony. I fix it creating one more time CPT with the same slug and don’t use special character in “Singular Name”.

    Today, I’m meeting another problem. If I create a place with special characters, custom fields stay empty when I save it. It’s embarassing because people can’t add place with special characters (eg. Boite à Bière).

    A fix would be to put an htmlentities function in the field recording. I would need to know where I can add this function ? Could you help me ?

    #12653

    Guust
    Moderator
    Post count: 29970

    Hi Tom, I split your topic from https://wpgeodirectory.com/support/topic/creating-a-new-custom-post-type-bug

    I alerted Stiofan for you.

    #12680

    TØm Babwá
    Buyer
    Post count: 42

    Thank you Guust !

    To resume, GD don’t like french characters in :
    – CPT Singular name
    – Listing name

    #12682

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    Hi Tom,

    I tested and it seemed to work fine, see here: http://ppl.directory/places/united-kingdom/dumfries-and-galloway/thornhill/attractions/boite-a-biere/

    Can you let me know a way i can replicate you problem.

    Thanks,

    Stiofan

    #12685

    TØm Babwá
    Buyer
    Post count: 42

    I will do more test and I will give you more information ;).

    I’m scared to use special character since I crash the website with the CPT bug.

    #12714

    Guust
    Moderator
    Post count: 29970

    Tom, if you are worried, just backup your database first. Then you can go back.

    I attach a screenshot of my test site, and have a look at this URL as well:
    http://goldroo.net/kolacica/australia/queensland/brisbane/health/bolgen-moi-hovikodden/

    #12722

    TØm Babwá
    Buyer
    Post count: 42

    Ok, I think I make a mistake. There is no problem with special character in Listing Name !

    I find a problem with Facebook URL.
    Cette URL ne passe pas dans le champ “Facebook” : https://www.facebook.com/pages/La-Capsule-Cave-%C3%A0-Bi%C3%A8re/245700975494863

    I’m thinkink the problem come from Facebook URL encoding for special characters.

    GD don’t like the % maybe ?

    #12749

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    ok found the problem, it was % were not being escaped before wpbd->prepare and breaking things.

    I have added the fix and it will be in the next version.
    to fix now please edit geodirectory-functions/post_functions.php line 444

    Add this:

    $post_meta_set_query = str_replace('%', '%%',  $post_meta_set_query);// escape %

    so the surrounding lines are this:

    
    
    $post_meta_set_query = trim($post_meta_set_query,", ");
    
    		$post_meta_set_query = str_replace('%', '%%',  $post_meta_set_query);// escape %
    		
    		do_action('geodir_before_save_listinginfo',$postinfo_array, $post_id);

    Thanks,

    Stiofan

    #12757

    TØm Babwá
    Buyer
    Post count: 42

    Thanks for the fix Stiofan !

    #12782

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    You are welcome! 🙂

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

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

Open Support Ticket
20% Discount Offer
Hurry! Get your 20% discount before it expires. Get 20% Discount