Skip to content
This repository has been archived by the owner on Apr 23, 2022. It is now read-only.

cleanRequestData modifies arguments causing a set call to not work as required #14

Open
brycied00d opened this issue Mar 31, 2012 · 0 comments

Comments

@brycied00d
Copy link
Owner

What steps will reproduce the problem?

  1. Call the set function with multiple "files-wanted" values, such as $arguments[ 'files-wanted' ] = array( 0,1,2,3,4 );
  2. Dump the evaluated value of "json_encode( $arguments );" before the call to cleanRequestData in the request function, and again afterwards to see the effect its having.

File Id 0 ends up being dropped from the arguments, whilst all other numbers now have an associated key, which Transmission doesn't seem to like and ignores all values. Also makes File Id 0 impossible to set.

What is the expected output? What do you see instead?
I expect: "files-wanted":[0,1,2,3,4]
I get : "files-wanted":{"1":1,"2":2,"3":3,"4":4}

What version of the product are you using? On what operating system?
v0.3, Windows 7, PHP v5.2.17

Please provide any additional information below.

Its the same with a set request for "files-unwanted".
Single Ids on their own aren't affected, except for specifying an Id of 0, which as a result of being stripped out leaves the id list empty and as per the spec, means all files will be marked as wanted/unwanted instead.
Commenting out the call to cleanRequestData gets the result I expect, but breaks other functionality.

Google Code Info:
Issue #: 14
Author: [email protected]
Created On: 2011-05-27T14:04:04.000Z
Closed On:

@ghost ghost assigned brycied00d Mar 31, 2012
drj7z added a commit to drj7z/PHP-Transmission-Class that referenced this issue May 25, 2015
brycied00d pushed a commit that referenced this issue Oct 19, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant