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

Debug error help please | Forum

Abbey
Abbey May 15 '16
Hi I am getting the following errors in debug and I'm unsure how to fix them, can anyone help?



OW Debug - Notice Message: Undefined variable: attrName File: /home/xxxxxx/public_html/ow_system_plugins/base/bol/theme_service.php Line: 624

OW Debug - Notice Message: Undefined variable: selector File: /home/xxxx/public_html/ow_system_plugins/base/bol/theme_service.php Line: 626

OW Debug - Notice Message: Undefined offset: 1 File: /home/xxxxxx/public_html/ow_system_plugins/base/bol/theme_service.php Line: 634

OW Debug - Notice Message: Undefined offset: 1 File: /home/xxxxxx/public_html/ow_system_plugins/base/bol/theme_service.php Line: 634

OW Debug - Notice Message: Undefined offset: 1 File: /home/xxxxxx/public_html/ow_system_plugins/base/bol/theme_service.php Line: 634

OW Debug - Notice Message: Undefined offset: 1 File: /home/xxxxxx/public_html/ow_system_plugins/base/bol/theme_service.php Line: 634

OW Debug - Notice Message: Undefined offset: 1 File: /home/xxxxxx/public_html/ow_system_plugins/base/bol/theme_service.php Line: 634

OW Debug - Notice Message: Undefined offset: 1 File: /home/xxxxxx/public_html/ow_system_plugins/base/bol/theme_service.php Line: 634

OW Debug - Notice Message: Undefined offset: 1 File: /home/xxxxxx/public_html/ow_system_plugins/base/bol/theme_service.php Line: 634

OW Debug - Notice Message: Undefined offset: 1 File: /home/xxxxxx/public_html/ow_system_plugins/base/bol/theme_service.php Line: 634

OW Debug - Notice Message: Undefined offset: 1 File: /home/xxxxxx/public_html/ow_system_plugins/base/bol/theme_service.php Line: 634

OW Debug - Notice Message: Undefined offset: 1 File: /home/xxxxxx/public_html/ow_system_plugins/base/bol/theme_service.php Line: 634

OW Debug - Notice Message: Undefined offset: 1 File: /home/xxxxxx/public_html/ow_system_plugins/base/bol/theme_service.php Line: 634

OW Debug - Notice Message: Undefined offset: 1 File: /home/xxxxxx/public_html/ow_system_plugins/base/bol/theme_service.php Line: 634

OW Debug - Notice

Message: Undefined offset: 1 File: /home/xxxxxx/public_html/ow_system_plugins/base/bol/theme_service.php Line: 634
dave Leader
dave May 15 '16
Hi Abbey, 


they are all notices not errors.  What they mean is that the variable was not set before using it the first time. 


So lets say you have a php variable name $value  and in the script you load the page and then somewhere in the code you have 


$value = 'whatever';  


you will get a notice that says value was undefined because you did not initialize it first before using it. 


So to fix it, at the top of the php page you would have this.. 


if(!isset($value)) { $value = ''; }


this tells php that if the value is not set on page load to load it with '' (nothing) 


Now this can happen with arrays and offsets as well.  An offset is a part of an array. 


Such as $product['price']  


This happens because the developer did not set up a path for 


what happens is the array is empty?   


So if you look for product and the array is empty and there is no php code telling php "hey if its empty then display no records found"   then you will get usually not only a notice for the array but also for the offset which would be ['price']  for example.


That is why you get those, and unless you know php you would have to have the developer fix it because they forgot to put in code to handle the case of nothing found. 


Notices are not fatal errors and usually they do not effect the performance of the script unless in your case it is the offset  for which sometimes its just a empty page with debug off. 


Hope that makes sense. 


The problem is that alot of developers (unlike me) dont take the time to initialize all their variables.  All my scripts have a long list of those examples at the top of the php page.  Lazy devs dont bother to do it because its not fatal and if its not fatal they dont worry about it. 


However those notices will get a plugin kicked back, ross will not approve them if they have notices. 


Dave

The Forum post is edited by dave May 16 '16
Abbey
Abbey May 15 '16
Well it seems he missed this one...... it's a 3rd party theme
dave Leader
dave May 16 '16
Not in the theme, there is no php in a theme.  
The Forum post is edited by dave May 16 '16
ross Team
ross May 16 '16
Abbey are you sure you don't have debug and dev modes enabled at the same time?