• Resolved Sylvie Massey

    (@sylviemassey)


    Hello !
    I’ve installed Events manager with Divi thème, 2 months ago (all is updated). That’s ok except this point: I put a custom attribut in location (and also an other one in event with the same problem) which should be taken in a list. That’s ok. But if I want to change the value of this attibute and I save, the value remains the previous one. Impossible to save the change of the attibute’s value.

    I hope it’s clear. I beg your pardon for my poor english..
    Thank you for help

    The page I need help with: [log in to see the link]

Viewing 15 replies - 1 through 15 (of 16 total)
  • Plugin Support angelo_nwl

    (@angelo_nwl)

    hi,

    we tried this one and seems to be working fine on our test servers; just to narrow down the problem and help us debug the issue is it possible to try the following temporarily:

    – deactivating all other plugins to see if this resolves the problem. If this works, re-activate the plugins one by one until you find the problematic plugin(s).
    – switching to the default theme to rule out any theme-specific problems

    Thread Starter Sylvie Massey

    (@sylviemassey)

    Hello,

    I’ve tried what you said.
    But it doesn’t work. It’s not possible to change the attribute for location and for event, even I deactivate all other plugins and switch the theme. The bug is allways there.

    I’ve tried to look for this attibute in the data base. But I can’t see them anywhere. Could you say me in which table I could find them (and modify them…)
    Thank you !

    DO you have an ad-blocker running in your browser? Deactivate that and try again. I could not even open the screen options (slider at the top of WP Admin) when AdGuard is enabled.

    Thread Starter Sylvie Massey

    (@sylviemassey)

    Thank you, Patrick, for trying to help me but that is not the case.

    I always have my problemv with Events manager.

    @angelo_nwl, another idea ?
    Could you tell me where the attributes are saved in the data base ?
    Thank you

    Well, at least we’ve excluded that option, then ??

    Attributes are saved as normal post_meta. So, if your location has Post ID (not Location ID) 34 and your attribute is #_LATT{mapit} (for example), then the value of that is stored as a normal post meta for post ID 34 with key mapit.

    <?php 
    $value = get_post_meta( '34', 'mapit', true);
    echo $value;
    ?>

    So, the actual SQL table it is stored in, is wp_postmeta. Or, if you’re on a MultiSite installation: wp_[blognumber]_postmeta. ??

    Thread Starter Sylvie Massey

    (@sylviemassey)

    Do you think I will be able to change this value in the data base directly ?
    I’ve never done it but I can try on the local site.

    Yes, you can, but editing the SQL database directly does require some knowledge, so this is at your own risk. ??

    In PHP you can use:
    update_post_meta( $post_id, $key, 'new_value');
    Where $post_id = the post ID of the location and $key = the name of the attribute.

    Directly in mySQL in phpMyAdmin:
    "UPDATEwp_postmetaSETmeta_key= '[New Value]' WHEREpost_id= '[Post ID]';"
    NOTE: There is a difference in ` and ‘.
    Leave the [ out, of course.

    So, if your Location has post ID 10 and you want to set the #_LATT{gotomap} value to “https://maps.google.com&#8221;, the SQL query would be:

    UPDATE wp_postmeta SET gotomap = ‘https://maps.google.com&#8217; WHERE post_id = ’10’;

    Third option…
    Update directly in the database, but using PHP:

    
    <?php 
    global $wpdb;
    $post_id = '10';
    $key = 'gotomap';
    $new_value = 'My new attribute value';
    
    $sql = $wpdb->query( "UPDATE wp_postmeta SET {$key} = '{$new_value}' WHERE post_id = '{$post_id}'" );
    
    // to execute the query:
    echo $sql;
    ?>
    
    Thread Starter Sylvie Massey

    (@sylviemassey)

    Thank you for your help.
    I will read carefully and try on my local data base.
    And i will say to you if it’s ok !
    Have a nice day !

    Glad I could help out ??
    The safest way is update_post_meta(), btw. ??

    Good luck!

    Thread Starter Sylvie Massey

    (@sylviemassey)

    hello @duisterdenhaag !
    First I look for the 2 attributes I created in the data base in the wp_postmeta table. And …
    now I understand better how it’s working and I wonder if I found the problem : I create an attribute in event (with ATT) and another one in location (with LATT) BUT…
    I gave the same name for two of them because I thought they were saved separately but it’s not the case.

    So do you think it’s the core of my problem ?

    And if so, what sould I do ?
    1) delete the 2 attributes, save, create two attributes with two other name, and fill attributes for all the events and location
    2) delete only 1 attribute (for example location), save, create another attribute with another name and fill attributes for all the location
    3) other…

    Than you for your help (thank you so for your previous help : I understand much better the way WoprPress is working !)

    Thread Starter Sylvie Massey

    (@sylviemassey)

    sorry for my english because I mixed past and present … I hope You will understand…

    Hi Sylvie,

    It could be the cause that you named both attributes the same, but on the other hand, each value (post_meta) is saved in a different post_id… I do think that there is a difference in #_ATT and #_LATT – mostly in how EM searches for the value. The L is clearly for Location. LOL. But I guess the devs can better answer that.

    Please try different keys and let me/us know if it works.

    If you have trouble saving other meta data in posts and pages as well, there might be another problem.

    Good luck!
    Patrick.

    Thread Starter Sylvie Massey

    (@sylviemassey)

    Hi @duisterdenhaag !
    I’ve found it !!!!
    I only put a ‘ in the attibute’s text !
    So I replace ‘ by a space and it works !!! yes !

    Do you know a way to write the ‘ without problem ? /’ for example ?

    All special characters need to be escaped by a backslash: \

Viewing 15 replies - 1 through 15 (of 16 total)
  • The topic ‘Can’t modify a custom attributes in location/events’ is closed to new replies.