0

Notice: Use of undefined constant test - assumed 'test'.

I am not sure where this error came from. I am using the Widget Logic Plugin and is fully updated, but I can't seem to find where this issue is. Has anyone had this issue and know how to resolve it?

enter image description here

xivo
  • 2,054
  • 3
  • 22
  • 37
  • You should log the file name and line number as well, that done will normally tell you where the error is located. – hakre Sep 18 '12 at 14:28
  • I have a feeling it has to do with Phalanger and Widget Logic. I'm not sure what they use. I need to figure out how to turn on errors with WPDOTNET – xivo Sep 18 '12 at 14:30
  • It might also be in eval'ed code, but I'm not fluent with Widget Logic, so this is just an assumption. You might want to turn notices into exceptions though: http://php.net/manual/en/class.errorexception.php – hakre Sep 18 '12 at 14:43

1 Answers1

7

The most likely answer is that you have missed a $ on a variable called $test and used test in your code somewhere.

This is hard to verify without your code, but the error message you are referring to is what generally happens when a variable is written without the $ at the start - PHP tries to assume it is a constant of the same name.

The second option is that there is an array index 'test' with the missing quotes, i.e. $array[test] instead of $array['test'].

Edit: If you are not writing any code yourself, and using only using plug-ins, you might want to do two things:

  • See if you can find the error in their code (search for a variable called test without a $ in front of it
  • Raise a bug on their site, so that they can update it
Fluffeh
  • 33,228
  • 16
  • 67
  • 80
  • I think the OP says he has not written the code but just used an existing plugin. – Aleks G Sep 18 '12 at 14:15
  • Yes that is correct, I need to see where this variable is. I was hoping to see if anyone knew where I might start looking in Widget Logic. But I think I'll check the site for now to see if I can find any existing issues. I think it has to do with `Widget Logic` - thanks – xivo Sep 18 '12 at 14:47
  • enable debug mode to see the position (file, line, column) of that warning. – Jakub Míšek Sep 18 '12 at 20:26