Opened 5 years ago

Closed 5 years ago

#953 closed Bug (fixed)

API doesn't handle null default parameters well...

Reported by: vipsoft Owned by:
Priority: normal Milestone: Piwik 0.4.4
Component: Core Keywords:
Cc: Sensitive: no

Description

Let's say API.php contains:

public function test($idSite = null)
{
}

Unless the method is called with idSite non-empty, Piwik returns:

<result>
<error message="The parameters are not valid. The method called requires 0 parameters. Please check your URL and the method API."/>
</result>

Change History (5)

comment:1 Changed 5 years ago by vipsoft (robocoder)

  • Summary changed from API doesn't handle default parameters well... to API doesn't handle null default parameters well...

comment:2 Changed 5 years ago by vipsoft (robocoder)

  • Resolution set to wontfix
  • Status changed from new to closed

comment:3 Changed 5 years ago by matt (mattab)

  • Resolution wontfix deleted
  • Status changed from closed to reopened

why wontfix? it sounds like a bug..

comment:4 Changed 5 years ago by vipsoft (robocoder)

The exception is generated in the check for null parameters. So, I assumed this was by design/intentional.

comment:5 Changed 5 years ago by vipsoft (robocoder)

  • Resolution set to fixed
  • Status changed from reopened to closed

In [1466], fixes #953 - API doesn't handle default null parameters; remove checkParametersAreNotNull

Note: See TracTickets for help on using tickets.