[Midas] Possible bug in Upload API

Zach Mullen zach.mullen at kitware.com
Wed Nov 14 09:49:02 EST 2012


Hi Hal,

Good find, this is indeed a bug -- either this is an undocumented required
(redundant) parameter or we should just use the code you suggest when
loading the item.

Michael, I notice this change was introduced on commit 5966d95d as part of
topic branch http://public.kitware.com/MidasBT/view.php?id=753.  What do
you suggest as a fix? (I have opened
http://public.kitware.com/MidasBT/view.php?id=876)

Thanks,




On Wed, Nov 14, 2012 at 9:27 AM, Hal Canary <hal at cs.unc.edu> wrote:

> 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
> ______________________________**_________________
> Midas mailing list
> Midas at public.kitware.com
> http://public.kitware.com/cgi-**bin/mailman/listinfo/midas<http://public.kitware.com/cgi-bin/mailman/listinfo/midas>
>



-- 
Zach Mullen
R & D Engineer
Kitware Inc.
919-869-8858
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/midas/attachments/20121114/cc6434eb/attachment.html>


More information about the Midas mailing list