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">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">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"><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>-- <br>Zach Mullen<br>R & D Engineer<br>Kitware Inc.<br>919-869-8858<br>
</div>