Page 1 of 1

How To Diagnose & Resolve Undefined Variable Error messages?

Posted: Tue Oct 18, 2016 5:06 pm
by Khal
I have OC 2.0.1.1

I keep seeing the following error messages in my error log:

Code: Select all

Undefined variable: entry_captcha in ...public_html/system/modification/catalog/view/theme/default/template/product/product.tpl on line 111
PHP Notice:  Undefined variable: yandex_compatible in .../public_html/system/modification/catalog/view/theme/default/template/product/product.tpl on line 428
I recently installed a SEO module and I think that might be causing the issue, but how can I fix the errors?

I also have the OCJ Doc Mod, which has identified 4 of my modules as showing NOT FOUND errors. But these are are modules that I had installed from before and they were working fine. So I assume that this new extension is causing a conflict with my older modules? The common NOT FOUND error seems to be related to the product.tpl

My question is, how can I identify what is causing the issue and how to fix it?

Thank you

Re: How To Diagnose & Resolve Undefined Variable Error messa

Posted: Tue Oct 18, 2016 5:25 pm
by paulfeakins
Khal wrote:My question is, how can I identify what is causing the issue and how to fix it?
If you're not a developer, and don't want to become one, probably best to ask the extension developer to fix or pay one to fix failing that.

Re: How To Diagnose & Resolve Undefined Variable Error messa

Posted: Mon Oct 24, 2016 1:06 am
by cyclops12
Khal wrote:I have OC 2.0.1.1
I recently installed a SEO module and I think that might be causing the issue, but how can I fix the errors?



My question is, how can I identify what is causing the issue and how to fix it?

Thank you
disable the module and refresh all caches, then if the errors disappear then you know its definitely the new module causing trouble

Re: How To Diagnose & Resolve Undefined Variable Error messa

Posted: Mon Oct 24, 2016 4:04 pm
by Khal
Thanks for the reply.

I asked the developer of the new module and he said that his extension does not use those variables, so it can't be that extension causing the errors.

I have narrowed it sown to a previous SEO extension which I had on my site, but I deleted the extension and completed removed all of the files through File Manager too. However, I think there might still be some database entries which are causing the errors and I don't know how to remove them. I have contacted the extension developer to see if they can offer any assistance but have not heard anything back yet, it's been a week or so.

Re: How To Diagnose & Resolve Undefined Variable Error messa

Posted: Mon Oct 24, 2016 4:16 pm
by OSWorX
Unfortunately many templates are also changing standard files (while the should not do so!).
So when looking at your error:
Undefined variable: entry_captcha in ...public_html/system/modification/catalog/view/theme/default/template/product/product.tpl on line 111
PHP Notice: Undefined variable: yandex_compatible in .../public_html/system/modification/catalog/view/theme/default/template/product/product.tpl on line 428
you should compare that file with the original (and replace it).
Because when you look in the original file, there are no entries like that!

Re: How To Diagnose & Resolve Undefined Variable Error messa

Posted: Tue Oct 25, 2016 4:39 pm
by Khal
Ok thanks for the suggestion.

My corresponding lines in system/modification....product.tpl are:

line 111:

Code: Select all

 <label class="control-label" for="input-captcha"><?php echo $entry_captcha; ?></label></div>
lines 428-430:
<?php echo $product['special']; ?><?php if(!$yandex_compatible) echo '</span>' ?></span> <span class="price-old"><?php echo $product['price']; ?></span>
<?php } else { ?>

I have checked the file in catalog/view/theme... product.tpl and these lines are different so there must be a modification making these changes, is that right?


Thank you for your help

Re: How To Diagnose & Resolve Undefined Variable Error messa

Posted: Tue Oct 25, 2016 5:09 pm
by OSWorX
Khal wrote:Ok thanks for the suggestion.

My corresponding lines in system/modification....product.tpl are:

line 111:

Code: Select all

 <label class="control-label" for="input-captcha"><?php echo $entry_captcha; ?></label></div>
lines 428-430:
<?php echo $product['special']; ?><?php if(!$yandex_compatible) echo '</span>' ?></span> <span class="price-old"><?php echo $product['price']; ?></span>
<?php } else { ?>

I have checked the file in catalog/view/theme... product.tpl and these lines are different so there must be a modification making these changes, is that right?


Thank you for your help
I would say: yes.
Wether you use VQMod or OCMod, for both it will be the same procedure: chck the .xml which came with the extension.
There inside you can see all what it is changing/adding/removing.
Adjust that to your needs and it should work.

Re: How To Diagnose & Resolve Undefined Variable Error messa

Posted: Tue Oct 25, 2016 5:55 pm
by Khal
But that's the issue- I have already deleted the xml file and all other files of the extension causing these errors. That's why I thought must be something else like a database entry?

Re: How To Diagnose & Resolve Undefined Variable Error messa

Posted: Tue Oct 25, 2016 6:07 pm
by cyclops12
I would rename the error log to something like error_log_old then refresh all your caches and see if the errors reappear in the newly created error log.....you might be chasing an old error

Re: How To Diagnose & Resolve Undefined Variable Error messa

Posted: Tue Oct 25, 2016 6:31 pm
by OSWorX
Khal wrote:But that's the issue- I have already deleted the xml file and all other files of the extension causing these errors. That's why I thought must be something else like a database entry?
So, what is it??
A VQMod or OCMod?
If 2nd, check your database table modification.

Re: How To Diagnose & Resolve Undefined Variable Error messa

Posted: Tue Oct 25, 2016 6:53 pm
by Khal
It was an ocmod

Where can I find the database modification table? Is it through phpMyAdmin? And do I just find those variables and delete them?
cyclops12 wrote:I would rename the error log to something like error_log_old then refresh all your caches and see if the errors reappear in the newly created error log.....you might be chasing an old error
I have already refreshed all of my caches a few times and refreshed the modification list, but still the error is there.

Re: How To Diagnose & Resolve Undefined Variable Error messa

Posted: Tue Oct 25, 2016 7:02 pm
by OSWorX
Khal wrote:It was an ocmod

Where can I find the database modification table? Is it through phpMyAdmin? And do I just find those variables and delete them?
cyclops12 wrote:I would rename the error log to something like error_log_old then refresh all your caches and see if the errors reappear in the newly created error log.....you might be chasing an old error
I have already refreshed all of my caches a few times and refreshed the modification list, but still the error is there.
Then it is in the database (why cannot tell the people here such important things in the first post .. only wasting time!).
And as already written: table modification
And yes, for example phpMyAdmin, but for sure not my grandmother.

And one final - and last - note: when it is a OCMod, simply DISABLE this extension AND afterwards DELETE (for both actions are buttons existing).
It seems that people cannot read anymore .. or do not want.