We build. You grow.

Get best community software here

Start a social network, a fan-site, an education project with oxwall - free opensource community software

Undefined Index: skip and Trying to get non-object | Forum

Guna
Guna Sep 24 '14
I am creating a plugin. I have a form in a page called "Create" where user information like name, age and etc gathered except files. 


Once the "Create" form successfully submitted, It will redirect to documents upload page namely "File upload", where a form is having file upload elements. User can skip this step by clicking the skip button.


Now, I passed a "skip-url" from the "Create" page to "File upload" to skip. Once skip url is clicked, user will be redirected to another page. I am having problem with the "skip-url".


Below are my tried code.

class ENQUIRY_CTRL_Enquiry extends OW_ActionController {public function create(){

  $this->setPageTitle(OW::getLanguage()->text('enquiry', 'index_page_title')); 
  $this->setPageHeading(OW::getLanguage()->text('enquiry', 'index_page_heading'));


  $enquiry_form = new Form('enquiry_form');  $enquiry_form->setEnctype(Form::ENCTYPE_MULTYPART_FORMDATA);


  $fieldFromtext = new TextField('from');

  $fieldFromtext->setRequired();

  $fieldFromtext->setLabel($this->text('enquiry','enquiry_from'));

  $enquiry_form->addElement($fieldFromtext);

  $child_image = new FileField('child_image');

  $child_image->setLabel($this->text('enquiry', 'enquiry_child_image'));

  $enquiry_form->addElement($child_image);

  $fieldEmailtext = new TextField('from_email');

  $fieldEmailtext->setRequired();

  $fieldEmailtext->setLabel($this->text('enquiry','enquiry_email'));

  $fieldEmailtext->addValidator(new EmailValidator());

  $enquiry_form->addElement($fieldEmailtext);


  $this->addForm($enquiry_form);


  if ( OW::getRequest()->isPost() )

        {

            if ( $enquiry_form->isValid($_POST) )

            {

// Adding the form values to DB working fine. So no code provided for that.

$enquiry_form->reset();

OW::getFeedback()->info($this->text('enquiry', 'enquiry_success'));

$this->assign('skip',OW::getRouter()->urlForRoute('enquiry.view'));   

$this->redirect('enquiry/upload');

}

}


in enquiry_upload.html


<div class="ow_std_margin"><a class='ow_center' href="{$skip}">{text key='enquiry+skip'}</a></div> is showing error.


Error: Undefined Index: skip

and Trying to get non-objec.


How to over come this? Please help


The Forum post is edited by Guna Sep 24 '14
ross Team
ross Sep 24 '14
Topic was moved from Bug reports and troubleshooting.