Support » Plugin: Events Manager - Calendar, Bookings, Tickets, and more! » EM_Gateways::get_customer_field() returns all fields when field not found

  • Resolved webaware

    (@webaware)


    When calling EM_Gateways::get_customer_field() with a $field_name that does not exist, an array of all values is returned. This happens because $form_field_id has no value when $field_name is not found, triggering an undefined variable warning and retrieving all registration values instead of a selected value.

    NB: I only hit this because my eWAY payment integration uses the standard address fields from the booking, and some people delete some fields (e.g. Country) because they don’t require them.

    Also: I notice that when the person booking for the event is logged in and has a value defined, that value takes precedence over whatever is entered in the form — which might be an issue if the logged in user is booking on behalf of someone else.

    cheers,
    Ross

    http://wordpress.org/plugins/events-manager/

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

    (@angelo_nwl)

    hi,

    did you try something like this?

    eg.

    EM_Gateways::get_customer_field('address', $EM_Booking)

    Thread Starter webaware

    (@webaware)

    G’day Angelo,

    The situation I found is where the website builder has removed the Country field from the bookings form, and my code tries to access it:

    EM_Gateways::get_customer_field('country', $EM_Booking)

    This returns an array of all the meta, rather than an empty value, because the code in that method assumes the field will be found and doesn’t handle the case where the field is not found.

    I’m working around the bug for the country field specifically, but you should probably look at fixing it more generally.

    cheers,
    Ross

    Plugin Support angelo_nwl

    (@angelo_nwl)

    I see, am going to let at Marcus know about this.

    Plugin Author Marcus (aka @msykes)

    (@netweblogic)

    Sorry for the delay in sorting this out. We’ve just released EM 5.5.3 and Pro 2.3.8 and this issue should now be resolved. Thanks for reporting this!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘EM_Gateways::get_customer_field() returns all fields when field not found’ is closed to new replies.