Support » Plugin: Events Manager » $EM_Location->save() : Update Issue

  • Resolved rar_jds


    I’m trying to use $EM_Location->save() to update location data through an interface I’m writing. When the source system has different values than current EM Location, I want to update the EM Location.

    It works great when the address, name, or country code change … I can load $EM_Location with the new values plus updates to other items like state, postal code, and attributes, saves fine.

    However, it seems that if only the custom attributes change, the save() function is not updating the data. Same if only state, postal code change … the function does not update.

    Once there is an update to the address, name, or country code field … everything updates correctly. So it seems that the function is only evaluating the fields in $EM_Location->required_fields for processing updates.

    I’ve looked through the code and cannot find why/where it is doing this check (a little above my skill level at this point).

    Is this correct and desired functionality? If so, is there something I can pass that will trigger the update? Or will I just need to write my own function to do the update?

    Any help/advice is greatly appreciated.

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


    have you tried $EM_Location->save_meta() or hook into em_location_save_meta filter instead?


    I called save_meta after Save and it worked perfect.


    Thanks angelo_nwl

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘$EM_Location->save() : Update Issue’ is closed to new replies.