WebsiteBaker Logo
  • *
  • Templates
  • Help
  • Add-ons
  • Download
  • Home
*
Welcome, Guest. Please login or register.

Login with username, password and session length
 

News


WebsiteBaker 2.13.6 is now available!


Will it continue with WB? It goes on! | Geht es mit WB weiter? Es geht weiter!
https://forum.websitebaker.org/index.php/topic,32340.msg226702.html#msg226702


The forum email address board@websitebaker.org is working again
https://forum.websitebaker.org/index.php/topic,32358.0.html


R.I.P Dietmar (luisehahne) and thank you for all your valuable work for WB
https://forum.websitebaker.org/index.php/topic,32355.0.html


* Support WebsiteBaker

Your donations will help to:

  • Pay for our dedicated server
  • Pay for domain registration
  • and much more!

You can donate by clicking on the button below.


  • Home
  • Help
  • Search
  • Login
  • Register

  • WebsiteBaker Community Forum »
  • WebsiteBaker Support (2.8.x) »
  • Bakery Shop »
  • Bakery 1.72 save_form.php breaking template issue
  • Print
Pages: [1]   Go Down

Author Topic: Bakery 1.72 save_form.php breaking template issue  (Read 4241 times)

Offline sky writer

  • Posts: 926
Bakery 1.72 save_form.php breaking template issue
« on: October 05, 2015, 04:58:24 AM »
Not sure if this is a bug or something specific to my template.  If a field in the checkout "Submit order: Address" form is left blank or filled with an invalid entry, the page reloads with the warning "The fields highlighted in red are blank. Please enter the required information.", but the error check adds an extra closing div which breaks the/my template.  I was able to fix this issue by commenting out two lines in the save_form.php file.

In save_form.php the two checks, one for blank, one for invalid field are:

line ~42
Code: [Select]
// If blank fields show error message
if (isset($blanks)) {
   $form_error = $MOD_BAKERY['ERR_FIELD_BLANK'];
   $error_bg = $blanks;
   extract($_POST);
   include('view_form.php');
   echo $end_of_wrapper;  // End of bakery wrapper
   return;
}

line ~150
Code: [Select]
// If any errors occured show address form again
if (@is_array($errors)) { 
   $form_error = '';
   foreach ($errors as $value) {
      $form_error .= $value.'<br />';
   }
   $form_error .= '<br />'.$MOD_BAKERY['ERR_INVAL_TRY_AGAIN'];
   include('view_form.php');
   echo $end_of_wrapper;  // End of bakery wrapper
   return;
}

I commented out the problem line in both instances, like so:
Code: [Select]
/* echo $end_of_wrapper;  // End of bakery wrapper */
The end_of_wrapper string is defined in the view.php file line~ 144
Code: [Select]
// Add a wrapper for Bakery to help with layout
echo "\n<div id='mod_bakery_wrapper_f'>\n";
$end_of_wrapper = "\n</div> <!-- End of bakery wrapper -->\n";

and when this is added, in my template anyway, it results in two instances of:
Code: [Select]
</div> <!-- End of bakery wrapper -->like so:
Code: [Select]
<script type='text/javascript'>
      <!--
      mod_bakery_toggle_s tate_f('CA', 'cust', 0);
      -->
   </script>
</div> <!-- End of bakery wrapper -->
</div> <!-- End of bakery wrapper -->
         <div class="clear">
         </div>
      </div>

I haven't found any issues arising from commenting out these lines, but others more knowledgeable may want to test it and comment.

Hope this helps.
Logged

freeSbee

  • Guest
Re: Bakery 1.72 save_form.php breaking template issue
« Reply #1 on: October 05, 2015, 01:00:24 PM »
Hi sky writer

You are right. I was able to reproduce this and will fix it in the next version of Bakery. Thank you for the detailed bug report!

Regrads Christoph
Logged

Offline sky writer

  • Posts: 926
Re: Bakery 1.72 save_form.php breaking template issue
« Reply #2 on: October 05, 2015, 06:58:51 PM »
Glad to help.
Logged

Offline cookiesfromhome

  • Posts: 1
Re: Bakery 1.72 save_form.php breaking template issue
« Reply #3 on: October 27, 2015, 08:50:22 AM »
Nice post.Thanks for the information.
Logged

  • Print
Pages: [1]   Go Up
  • WebsiteBaker Community Forum »
  • WebsiteBaker Support (2.8.x) »
  • Bakery Shop »
  • Bakery 1.72 save_form.php breaking template issue
 

  • SMF 2.0.19 | SMF © 2017, Simple Machines
  • XHTML
  • RSS
  • WAP2