[Midas] Possible bug in Upload API

Hal Canary hal at cs.unc.edu
Wed Nov 14 09:27:54 EST 2012


Hello all,

I've found what seems to me to be a bug in the uploadPerform() function 
in the file modules/api/controllers/components/ApiComponent.php.  The 
midas.upload.perform method has a 'uploadtoken' parameter, but not 
'itemid' paremter.  Yet, in the code,  it references "$args['itemid']" 
which should be undefined.

   function uploadPerform($args)
     {
     /*..............*/
     list($userid, $itemid, ) = explode('/', $args['uploadtoken']);
     /*..............*/
     $item = $itemModel->load($args['itemid']);
     /*..............*/
     }

Shouldn't we repalce the line
     $item = $itemModel->load($args['itemid']);
with
     $item = $itemModel->load($itemid );

When I made this change, I was able to upload via the API inteface.

--
Hal



More information about the Midas mailing list