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!<div><br></div><div>-Mike<br><br><div class="gmail_quote">On Wed, Nov 14, 2012 at 12:02 PM, Zach Mullen <span dir="ltr"><<a href="mailto:zach.mullen@kitware.com" target="_blank">zach.mullen@kitware.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hal,<div><br></div><div>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.</div>
<div><br></div><div>Thanks again for the bug report.  Happy MIDASing!</div><div class="HOEnZb"><div class="h5">

<div><br></div><div><br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Nov 14, 2012 at 9:49 AM, Zach Mullen <span dir="ltr"><<a href="mailto:zach.mullen@kitware.com" target="_blank">zach.mullen@kitware.com</a>></span> wrote:<br>


<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Hal,<div><br></div><div>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.</div>


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



<div><br></div><div>Thanks,</div><div><br></div><div><br></div><div class="gmail_extra"><div><div><br><br><div class="gmail_quote">On Wed, Nov 14, 2012 at 9:27 AM, Hal Canary <span dir="ltr"><<a href="mailto:hal@cs.unc.edu" target="_blank">hal@cs.unc.edu</a>></span> wrote:<br>



<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello all,<br>
<br>
I've found what seems to me to be a bug in the uploadPerform() function in the file modules/api/controllers/<u></u>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.<br>




<br>
  function uploadPerform($args)<br>
    {<br>
    /*..............*/<br>
    list($userid, $itemid, ) = explode('/', $args['uploadtoken']);<br>
    /*..............*/<br>
    $item = $itemModel->load($args['<u></u>itemid']);<br>
    /*..............*/<br>
    }<br>
<br>
Shouldn't we repalce the line<br>
    $item = $itemModel->load($args['<u></u>itemid']);<br>
with<br>
    $item = $itemModel->load($itemid );<br>
<br>
When I made this change, I was able to upload via the API inteface.<br>
<br>
--<br>
Hal<br>
______________________________<u></u>_________________<br>
Midas mailing list<br>
<a href="mailto:Midas@public.kitware.com" target="_blank">Midas@public.kitware.com</a><br>
<a href="http://public.kitware.com/cgi-bin/mailman/listinfo/midas" target="_blank">http://public.kitware.com/cgi-<u></u>bin/mailman/listinfo/midas</a><br>
</blockquote></div><br><br clear="all"><div><br></div></div></div><span><font color="#888888">-- <br>Zach Mullen<br>R & D Engineer<br>Kitware Inc.<br><a href="tel:919-869-8858" value="+19198698858" target="_blank">919-869-8858</a><br>



</font></span></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br>Zach Mullen<br>R & D Engineer<br>Kitware Inc.<br><a href="tel:919-869-8858" value="+19198698858" target="_blank">919-869-8858</a><br>
</div>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br>Thanks,<br>Michael Grauer<br>R & D Engineer<br>Kitware, Inc.<br>919 969 6990 x322<br><br><br><br>
</div>