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

when i click on "ask Question" data is saved in database but form doesnot move to next page.? | Forum

suchita jain
suchita jain May 27 '15
Hello,

i am developing a question answer plugin.when i click on "ask Question" data is saved in database but form doesnot move to next page.? it shows some error
Attachments:
  save.JPG (89Kb)
  bol(1).zip (260Kb)
ross Team
ross May 27 '15
Topic was moved from Bug reports and troubleshooting.
dave Leader
dave May 27 '15
Just be sure your using return in your bol function to return to service and return in service to return to the script if thats the way your doing it.  Then use the redirect on save to go where you want to go. 


$this->redirect(OW::getRouter()->urlForRoute('pluginName.pageName'));


suchita jain
suchita jain May 27 '15
Hello dave,

i made this plugin from reference of other , please explain in detail & see the attachment where i have to change ? i can not find the flow of this plugin.
dave Leader
dave May 27 '15
For example: 


php file: 


$whatever = $this->service->goSaveSomething($values);


if($whatever)

{

    //the item was saved, show confirm message and redirect user

    $this->redirect(OW::getRouter()->urlForRoute('pluginName.pageName'));


 }else{


            //the item was not saved and show error and redirect user or not

               $this->redirect(OW::getRouter()->urlForRoute('pluginName.pageName'));


         }//close else



In bol service php 


function goSaveSomething($data)

{


  $didWeSave =  pluginName_BOL_FilenameDao::getInstance()->save($data);


  return $didWeSave;

 }


in bol Dao file


function save($thedata)

{


   $isSaved = save process


   return $isSaved;


 }



u get the idea, return from each function and then check for value in php file, it should be 1 or 0 in most cases, 1 true = success  0 false = failed   then show error or confirm message and redirect accordingly. 


suchita jain
suchita jain May 28 '15
Hello dave ,
i am having an exeption but unable to find what is this? please see the attachment exception.jpg
Attachments:
  exception.jpg (306Kb)
suchita jain
suchita jain May 29 '15
Hello ,

Please give me suggestion its not working
dave Leader
dave May 29 '15
I dont know either sorry, that is strange.   I wont be on for a few days as i have a project i am working on.  
Alia Team
Alia Jun 2 '15
suchita jain,

You are getting 500 internal server error first. Open up this POST >> Response section >> see whether you will find more info on what happened.

In most of the cases cause of internal server error gets saved in server error logs. You might want to check them.

With regards to uncaught exception, you will also need to troubleshoot this.
Enable DEBUG mode in config.php and use following guide to find out actual error message: https://docs.oxwall.org/faq:parse-error-troubleshooting