One shot Warning from an archive page

Notice: Undefined variable: weights in /home/pjroth/public_html/sowearedads.com/zp-core/class-search.php on line 1436

I don't think this is a user that any user without admin privileges would ever see but I'll mention it anyhow. I think it is probably because all my albums and photos are unpublished. This line in class-search.php is trying to pull info from $weights[]. The actual line is,
`

$images[] = array('filename' => $row['filename'], 'folder' => $albumrow['folder'], 'weight'=>$weights[$row['id']]);

`
It only happens the first time I try to follow a link for one of the monthly archives. I guess after that $weights[] has been properly loaded up. I tried it with the zenpage theme as well but it doesn't look to be theme related at all. Of course I could be wrong but it does happen with zenpage theme as well.
My site is currently, Zenphoto version 1.4.3.1 [10590] with a custom theme which was why I tested with the Zenpage theme.

EDIT: I forgot to mention that the warning line is printed once for each item in the archive item. So when I have May(14) I will have 14 lines of warnings. Also, I understand I am only seeing this because I currently have a debug build.

Comments

  • Actually I was wrong. For some reason the warning output doesn't occur every time. It does still happen. I'm guessing a check would take care of the problem.
    Or turning off the debug part. :P
  • Maybe you can figure out the differences between when you get the error and when not. Basically, the weights array element should be present as that is how we sort the search results for relevance.
  • Sure thing. It is pretty minor and easy enough to test. I'll let you know.
Sign In or Register to comment.