Page 1 of 1

UNDEFINED VARIABLE: ENTRY_CAPTCHA IN

Posted: Thu Feb 25, 2016 10:13 pm
by WayneOB
Hello,

I'm using OC 2.0.2.0 with template monster theme.

Whilst everything else seems fine, I am seeing this error in contact page and returns page;
Image

Line 154 of RETURN_FORM.TPL is;

<div class="form-group required">
<label class="col-sm-2 control-label" for="input-captcha"><?php echo $entry_captcha; ?></label>
<div class="col-sm-10">
<input type="text" name="captcha" value="" placeholder="<?php echo $entry_captcha; ?>" id="input-captcha" class="form-control" />
</div>


I'm guessing by similar topics (viewtopic.php?f=182&t=145460 and viewtopic.php?f=182&t=149638) that the template is not compatible with 2.0.2.0.

If there is anyone that can help with this, point me in the right direction it would be much appreciated.

Re: UNDEFINED VARIABLE: ENTRY_CAPTCHA IN

Posted: Fri Feb 26, 2016 5:31 am
by Randem

Re: UNDEFINED VARIABLE: ENTRY_CAPTCHA IN

Posted: Fri Feb 26, 2016 5:19 pm
by WayneOB
Hi Randem,

Thanks for your reply.

I guessed that the problem with capture was due to me upgrading OC to 2.0.2.0. and that the templatemonster theme was not compatible with update :( ...As worked fine before the update.

I did try replacing the code in /view/theme/mytheme/template/information/contact.tpl;

Code: Select all

<div class="form-group required">
            <label class="col-sm-2 control-label" for="input-captcha"><?php echo $entry_captcha; ?></label>
            <div class="col-sm-10">
              <input type="text" name="captcha" id="input-captcha" class="form-control" />
            </div>
          </div>
          <div class="form-group">
            <div class="col-sm-10 pull-right">
              <img src="index.php?route=tool/captcha" alt="" />
              <?php if ($error_captcha) { ?>
                <div class="text-danger"><?php echo $error_captcha; ?></div>
              <?php } ?>
            </div>
          </div>
with code from /view/theme/default/template/information/contact.tpl;

Code: Select all

<?php if ($site_key) { ?>
            <div class="form-group">
              <div class="col-sm-offset-2 col-sm-10">
                <div class="g-recaptcha" data-sitekey="<?php echo $site_key; ?>"></div>
                <?php if ($error_captcha) { ?>
                  <div class="text-danger"><?php echo $error_captcha; ?></div>
                <?php } ?>
              </div>
            </div>
          <?php } ?>
Although this seemed to work, it threw out other issues when submitting form.

I am guessing that I also need to update the controller file; catalog/controller/information/contact.php, but not sure what to change here :(

If anyone is able to help here it would be appreciated, I am at a wall with this and site is ready to go live apart from this :(

Re: UNDEFINED VARIABLE: ENTRY_CAPTCHA IN

Posted: Fri Feb 26, 2016 5:26 pm
by Randem
How did you upgrade???
You should not changed OpenCart core files directly
Remove the template monster then test...

Debugging - http://www.randemsystems.com/support/op ... rt-system/

Re: UNDEFINED VARIABLE: ENTRY_CAPTCHA IN

Posted: Fri Feb 26, 2016 5:42 pm
by WayneOB
I upgraded as per OC upgrade instructions via ftp (override files)

If I switch theme to default there is no error and the Google Captcha works fine;
Image

Re: UNDEFINED VARIABLE: ENTRY_CAPTCHA IN

Posted: Fri Feb 26, 2016 5:56 pm
by Randem
We have a WINNER!!!
Your theme is causing your headaches.

Before you decide to upgrade again read this - http://www.randemsystems.com/support/op ... n-2-1-0-1/

Keep note of this - http://www.randemsystems.com/support/opencart/

Re: UNDEFINED VARIABLE: ENTRY_CAPTCHA IN

Posted: Fri Feb 26, 2016 6:08 pm
by WayneOB
Is there a way this issue can be fixed?
Can you suggest any code fix yourself?
or is it best to just roll back my version to 2.0.1.0??

I upgraded to 2.0.2.0 due to other OC issues with Custom HTML, where the recommended fix was to upgrade.

Unfortunately, I have spent a lot of additional time on this theme, tweaking to fit needs and to have to drop it due to 1 error would be a shame.

Thanks again

Re: UNDEFINED VARIABLE: ENTRY_CAPTCHA IN

Posted: Sat Feb 27, 2016 3:22 am
by WayneOB
Is it possible to undo the update by overwriting files with older version?

I have since discovered that there is another issue with 2.0.2.0 with regard to SMTP not working.

Thanks again

Re: UNDEFINED VARIABLE: ENTRY_CAPTCHA IN

Posted: Sat Feb 27, 2016 4:15 am
by Randem
This is why it is very important to use VQMOD & VQMOD Manager with OpenCart. You never directly change any OpenCart files so when you have trouble you can just remove all VQMOD XML file and have a clean system to test if the function worked before adding anything at all. If it did then you just add one MOD in at a time and test again until you find the MOD that broke the system...

Re: UNDEFINED VARIABLE: ENTRY_CAPTCHA IN

Posted: Sat Feb 27, 2016 4:20 am
by WayneOB
So, if I install a theme in future, I have to do it via VQMOD & VQMOD Manager?

Re: UNDEFINED VARIABLE: ENTRY_CAPTCHA IN

Posted: Sat Feb 27, 2016 4:27 am
by Randem
NO. Regular themes are just uploaded into the correct folder then chosen inside OpenCart in the store settings. They don't change OpenCart files at all, they just substitute all the theme files in a different folder.

Now, there are some themes out there which will replace OpenCart files and are Not recommended to use because you can't get rid of the them easily without a reload of OpenCart Software. It is Theme user beware!!!

Re: UNDEFINED VARIABLE: ENTRY_CAPTCHA IN

Posted: Sat Feb 27, 2016 5:10 am
by WayneOB
I believe that my issue is only due to an OC update affecting a variable in theme which was built for older version (2.0.1.1).

If there is no fix for this or no-one can help with code, is it possible for me to roll back to 2.0.1.1?

thanks again

Re: UNDEFINED VARIABLE: ENTRY_CAPTCHA IN

Posted: Sat Feb 27, 2016 6:09 am
by Randem
Your theme is the problem... If you did not take precautions to backup BEFORE the upgrade then your only recourse is to start over from scratch with a new install if that theme means that much to you. Otherwise get the author of the theme to fix it.