Skip to content

Bug in call21UpdateMethod #19

@rappasoft

Description

@rappasoft

I was attempting to update a customer and I realized that the PHP wrapper's call21UpdateMethod does not let you specify a key, but only a value. So it would pass:

<update_customer customerid="Mercury">

as

<update_customer key="Mercury">

So I modified the call from:

public static function call21UpdateMethod($function, $key, $phpObj, api_session $session)
{
$xml = api_util::phpToXml($function, array($phpObj));
$xml = str_replace("<$function", "<$function key="$key"", $xml);
return api_post::post($xml, $session, "2.1");
}

to:

public static function call21UpdateMethod($function, $key, $value, $phpObj, api_session $session)
{
$xml = api_util::phpToXml($function, array($phpObj));
$xml = str_replace("<$function", "<$function $key="$value"", $xml);
return api_post::post($xml, $session, "2.1");
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions