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">&lt;<a href="mailto:hal@cs.unc.edu" target="_blank">hal@cs.unc.edu</a>&gt;</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&#39;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 &#39;uploadtoken&#39; parameter, but not &#39;itemid&#39; paremter.  Yet, in the code,  it references &quot;$args[&#39;itemid&#39;]&quot; which should be undefined.<br>


<br>
  function uploadPerform($args)<br>
    {<br>
    /*..............*/<br>
    list($userid, $itemid, ) = explode(&#39;/&#39;, $args[&#39;uploadtoken&#39;]);<br>
    /*..............*/<br>
    $item = $itemModel-&gt;load($args[&#39;<u></u>itemid&#39;]);<br>
    /*..............*/<br>
    }<br>
<br>
Shouldn&#39;t we repalce the line<br>
    $item = $itemModel-&gt;load($args[&#39;<u></u>itemid&#39;]);<br>
with<br>
    $item = $itemModel-&gt;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 &amp; D Engineer<br>Kitware Inc.<br>919-869-8858<br>
</div>