Hello!
I am hoping someone can help me with this issue. One one of my client's websites we are having the "Fatal error: Exception thrown without a stack frame in Unknown on line 0" page after they submit from forms that were created using the custom form block code. This has not been an issue for the last year but it all of the sudden started to throw out this error. Below is the controller code, maybe this will help with figuring out the issue.
<?phpdefined('C5_EXECUTE') or die(_("Access Denied."));class UltimusSummitRSVPFormBlockController extends BlockController {/* ^^^^^^^^^^^^^^^^^
Change this portion
of the class name to
correspond with the
block's directory name
*/
protected $btDescription="Ultimus Summit RSVP Form";
protected $btName="Ultimus Summit RSVP Form";
protected $btTable='btUltimusSummitRSVPForm';//Change db.xml table name to match this
protected $btInterfaceWidth="500";
protected $btInterfaceHeight="450";
protected $btCacheBlockRecord=true;
protected $btCacheBlockOutput=true;
<?phpdefined('C5_EXECUTE') or die(_("Access Denied."));class UltimusSummitRSVPFormBlockController extends BlockController {/* ^^^^^^^^^^^^^^^^^
Change this portion
of the class name to
correspond with the
block's directory name
*/
protected $btDescription="Ultimus Summit RSVP Form";
protected $btName="Ultimus Summit RSVP Form";
protected $btTable='btUltimusSummitRSVPForm';//Change db.xml table name to match this
protected $btInterfaceWidth="500";
protected $btInterfaceHeight="450";
protected $btCacheBlockRecord=true;
protected $btCacheBlockOutput=true;
protected $btCacheBlockOutputOnPost=false;
protected $btCacheBlockOutputForRegisteredUsers=true;
protected $btCacheBlockOutputLifetime=300;publicfunction view(){$this->set('showThanks',$this->get('thanks'));}publicfunction action_submit_form(){$error=$this->validate_form($this->post());if($error->has()){//Fail -- re-display the form (C5 form helpers will repopulate user's entered data for us)$this->set('errors',$error->getList());}else{//Success -- send notification email and reload/redirect page to avoid browser warnings about re-posting content if user reloads page $this->send_notification_email($this->post());$this->redirect('/index.php?cID=325');}}publicfunction validate_form($post){//Note: this function can't just be called "validate" because then C5 automatically calls it to validate the add/edit dialog!$val= Loader::helper('validation/form');$val->setData($post);$val->addRequired('fname','You must enter your first name.');$val->addRequired('lname','You must enter your last name.');$val->addRequired('company','You must enter your company name.');$val->addRequiredEmail('email','You must provide a valid email address');$val->addRequired('address1','You must enter your address.');$val->addRequired('city','You must enter your city.');$val->addRequired('state','You must enter your state.');$val->addRequired('zip','You must enter your zip.');$val->addRequired('mer','Please select Yes or No for all options.');$val->addRequired('motr','Please select Yes or No for all options.');$val->addRequired('mdwt','Please select Yes or No for all options.');$val->addRequired('tbh','Please select Yes or No for all options.');$val->addRequired('tlh','Please select Yes or No for all options.');$val->addRequired('tddp','Please select Yes or No for all options.');$val->addRequired('wcs','Please select Yes or No for all options.');$val->addRequired('wbl','Please select Yes or No for all options.');$val->test();$error=$val->getError();//Perform manual checks (anything that the validation helper doesn't have rules for)$iph= Loader::helper('validation/ip');if(!$iph->check()){$error->add($iph->getErrorMessage());}//Note that we don't have to validate CSRF tokens ourselves// because C5 handles it for us via the $this->action() function.return$error;}privatefunction send_notification_email($data){$subject='['.SITE.'] Ultimus Client Summit RSVP';$optInString=$data['optIn'] ? 'Yes':'No';$bccemail=$data['email'];$body=<<<EOB
The following has been submitted to the Ultimus Summit RSVP:
Name: {$data['fname']} {$data['lname']}
Company: {$data['company']}
Email: {$data['email']}
Address:
{$data['address1']}{$data['address2']}
{$data['city']}, {$data['state']} {$data['zip']}
Monday Evening Welcome Reception (Hilton Netherland): {$data['mer']}
Monday Historic District Tour: {$data['motr']}
Monday Cincinnati-themed Dinner at the Woodward Theater: {$data['mdwt']}
Tuesday continental breakfast at the Hilton: {$data['tbh']}
Tuesday lunch at the Hilton: {$data['tlh']}
Tuesday Dinner at Drees Pavilion in Devou Park: {$data['tddp']}
Wednesday half day conference sessions: {$data['wcs']}
Wednesday box lunch: {$data['wbl']}
Dietary Restrictions: {$data['dr']}
EOB;//Dev Note: The "EOB;" above must be at the far-left of the page (no whitespace before it),// and cannot have anything after it (not even comments).// Seehttp://www.php.net/manual/en/language.types.string.php#language.typ...//Send email$mh= Loader::helper('mail');$mh->from('info@ultimusfundsolutions.com');$mh->to($this->notifyEmail);$mh->bcc($bccemail);$mh->setSubject($subject);$mh->setBody($body);//Use $mh->setBodyHTML() if you want an HTML email instead of (or in addition to) plain-text$mh->sendMail();}}
I forgot to mention that the form does submit and the sender gets a confirmation and the recipient get the form content. It just puts up white page with the error instead of redirecting.
Code
Post Reply
Delete Post
You are allowed to delete your post for 5 minutes after it's posted.