Bug in 2.2.1 ( on 2014–05–27) – addUpload

Notice: This thread is very old.
motorcb
Member | 552
+
0
-

I have simple form:

////////////////////////////////////////////////////////////////////////////
protected function createComponentMyForm()
{
    $form = new Form();

    $form->addUpload('avatar', 'Avatar:');

    $form->addSubmit( 'submit', 'Save' );

    $form->onSuccess[] = $this->saveMyFormSucceeded;

    return $form;
}

public function saveMyFormSucceeded( $form )
{
    $values = $form->getValues();

    dump( $values["avatar"] );
    dump( $values["avatar"]->isOk() );
    dump( $values["avatar"]->getContents() );
    exit();
}
////////////////////////////////////////////////////////////////////////////

dump( $values[“avatar”] );
Have allways (i tried many different files): error private ⇒ 6
dump( $values[“avatar”]->isOk() ); is allways FALSE
dump( $values[“avatar”]->getContents() ); is allways NULL

Bug? Why?