Skip to content
Snippets Groups Projects
Commit 9f97b743 authored by jev-odoo's avatar jev-odoo Committed by jev
Browse files

[FIX] service: rpc call with empty array (php)


Before this fix, trying to authenticate via
xml-rpc call from PHP following the documentation at
odoo.com/documentation/14.0/webservices/odoo.html#logging-in
raised an error:

    > $uid = $common->authenticate($db, $username, $password, array());
    TypeError: 'list' object is not a mapping

Because PHP doesn't have separate array and mapping types, the
XML-RPC encoder disambiguates based on the existence of
key => value pairs, such disambiguation yields an empty xmlrpc
array for an empty PHP array, which is unexpected on the Python
side.

Relax the check on the Python side:

* fixing this on the client side requires adding arbitrary and
  meaningless key => value to the empty array to force the
  correct disambiguation which is ugly and weird
* the example code has been there for a long time, so there's
  probably lots of such PHP code in the wild

opw-2388141

closes odoo/odoo#62077

Signed-off-by: default avatarXavier Morel (xmo) <xmo@odoo.com>
parent 0bebde19
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment