[Midas] Possible bug in Upload API

Michael Grauer michael.grauer at kitware.com
Wed Nov 14 12:04:44 EST 2012


Thanks for finding and reporting that bug Hal.  I had extensively tested
that method, but the bug in the tests mirrored the bug in the code!

-Mike

On Wed, Nov 14, 2012 at 12:02 PM, Zach Mullen <zach.mullen at kitware.com>wrote:

> Hal,
>
> Mike has just committed a fix for your bug and I have QA'd it and merged
> it into master branch.  If you do a git pull, you should have it.
>
> Thanks again for the bug report.  Happy MIDASing!
>
>
>
>
> On Wed, Nov 14, 2012 at 9:49 AM, Zach Mullen <zach.mullen at kitware.com>wrote:
>
>> 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
>>
>
>
>
> --
> Zach Mullen
> R & D Engineer
> Kitware Inc.
> 919-869-8858
>



-- 
Thanks,
Michael Grauer
R & D Engineer
Kitware, Inc.
919 969 6990 x322
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/midas/attachments/20121114/984dd53c/attachment.html>


More information about the Midas mailing list