Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Notice: Trying to get property of non-object

lechlech Chicagoland
edited September 2007 in Vanilla 1.0 Help
Hey all, (obligatory hat tip mark) it's been a while...

Just set up a small forum and caught this little bit of weirdness when attempting to hit a thread/account that doesn't exist and is completely out of range. Instead of getting a pretty error like this one for example, I get it plus a header which includes a handful to multiple instances of:

Notice: Trying to get property of non-object in /path/to/my/vanilla/whatever.the.relevant.php on line: nn
note that "whatever.the.relevant.php" file could be accounts.php to comments.php or whatever classes fall in between. It's leaving me a bit stumped at the moment.

Any ideas as to what could be causing this little gem? I've double checked the confs and It's a fairly fresh and clean vanilla setup with a few extensions, I'm just wondering if there's a common issue based on extension which may be causing this. I've disabled everything and it still likes to pop up with all extensions disabled as well :\ Friendly URLs are not enabled either.

Also, mark a quick run through roles within the database shows that:
s:27:"PERMISSION_DATABASE_CLEANUP";N;
Is still being created for the default initial four roles, wasn't this weeded out?

Comments

  • lechlech Chicagoland
    Bump-de-dump, anyone have any ideas? Mark, you out there?
  • I assume this was a fresh virgin install. What extensions were installed and then de-activated? Are there any discussions and comments?
  • Hunch says this is probably an uploaded as binary instead of ascii issue, or some files failed their FTP upload. The fact it happens where there should be an error message tells me that MessageCollector, NoticeCollector or ErrorManager were corrupted on upload.
  • lechlech Chicagoland
    Well, I deactivated extensions, double checked and even re-uploaded Vanilla. It's fairly virgin has users and discussions going and nothing extremely out of the ordinary unless you're reaching for a range that doesn't exist in either discussions or user accounts or anything that's called via ID. I've checked a friends forum and his appears to throw similar errors for a like-query when reaching outside or accessing a missing range. Not sure if it's mySQL responding incorrectly causing Vanilla to toss this or a simple hiccup. Next post I'll give you an example of files and line numbers.
  • lechlech Chicagoland
    here's a sample of the error when it's caught on accessing a user account that doesn't exist:

    Notice: Trying to get property of non-object in /path/to/vanilla/account.php on line 51 Notice: Trying to get property of non-object in /path/to/vanilla/account.php on line 54 Notice: Trying to get property of non-object in /path/to/vanilla/account.php on line 78

    Three simple errors get thrown just for account there where as accessing a thread that's missing outputs much more which looks like the following:

    Notice: Trying to get property of non-object in /path/to/vanilla/library/Vanilla/Vanilla.Control.CommentGrid.php on line 71 Notice: Trying to get property of non-object in /path/to/vanilla/library/Vanilla/Vanilla.Control.CommentGrid.php on line 71 Notice: Trying to get property of non-object in /path/to/vanilla/library/Vanilla/Vanilla.Control.CommentGrid.php on line 86 Notice: Trying to get property of non-object in /path/to/vanilla/library/Vanilla/Vanilla.Control.CommentGrid.php on line 86 Notice: Trying to get property of non-object in /path/to/vanilla/comments.php on line 43 Notice: Trying to get property of non-object in /path/to/vanilla/comments.php on line 51 Notice: Trying to get property of non-object in /path/to/vanilla/comments.php on line 56 Notice: Trying to get property of non-object in /path/to/vanilla/comments.php on line 56 Notice: Trying to get property of non-object in /path/to/vanilla/comments.php on line 59 Notice: Trying to get property of non-object in /path/to/vanilla/comments.php on line 64 Notice: Trying to get property of non-object in /path/to/vanilla/comments.php on line 64 Notice: Trying to get property of non-object in /path/to/vanilla/comments.php on line 64 Notice: Trying to get property of non-object in /path/to/vanilla/comments.php on line 67 Notice: Trying to get property of non-object in /path/to/vanilla/comments.php on line 72 Notice: Trying to get property of non-object in /path/to/vanilla/comments.php on line 72 Notice: Trying to get property of non-object in /path/to/vanilla/comments.php on line 72 Notice: Trying to get property of non-object in /path/to/vanilla/comments.php on line 75 Notice: Trying to get property of non-object in /path/to/vanilla/comments.php on line 80 Notice: Trying to get property of non-object in /path/to/vanilla/comments.php on line 80 Notice: Trying to get property of non-object in /path/to/vanilla/comments.php on line 80 Notice: Trying to get property of non-object in /path/to/vanilla/comments.php on line 83 Notice: Trying to get property of non-object in /path/to/vanilla/comments.php on line 88 Notice: Trying to get property of non-object in /path/to/vanilla/comments.php on line 88 Notice: Trying to get property of non-object in /path/to/vanilla/comments.php on line 88

    This at the moment is with extensions enabled, so I suspect that the error count in that last example is doubled as a result depending on which extensions are attempting to execute. But the commonality is consistent within the Vanilla.Control.CommentGrid.php file.
  • Hmm... Maybe a PHP version difference? Looking in account.php, $AccountUser is set false if the user account doesn't exist, and later comparisons on those lines treat it as if it still were an object... thus generating the error messages?
  • /me fruitlessly pokes around the internet trying to find a PHP 5 Vanilla. No matter, I can't see how this could be the cause--the technique is used everywhere in Vanilla and surely it would have been discovered earlier if it was the problem.
  • lechlech Chicagoland
    Php version is 5.0.5 and the mySQL version is 5.0.18. I couldn't locate anything amiss within the files themselves unless I overlooked something. While it's no big deal other than being a visual eyesore, I'd like to limit this to a simple error rather than have Vanilla spewing additional php errors :\
  • lechlech Chicagoland
    buhbump, anyone?
  • MarkMark Vanilla Staff
    I don't know if it's the way you've explained it, or the way I'm reading it - but I have absolutely no idea what you are talking about.
  • That's weird. Those things work just fine for my forum (just like here on these forums). Do you have the possibility of testing what happens if you copy over the files + database to a server with another version of MySQL and/or PHP?
  • lechlech Chicagoland
    @ Mark, basically when reaching for an account or thread number that doesn't exist. Instead of gracefully throwing a friendly error it tosses a couple of php errors (like the ones listed above) in the head of the document as well. I'll do another fresh install really under my local to see if it can be reproduced or not. @ bjrn. I tried that and for some strange reason it appears to produce the same errors when copied to local. I'll see what a fresh install produces again.
  • lechlech Chicagoland
    edited May 2007
    Fresh install on my local server here yields the same type of errors, reaching for a user account or thread range generates some php errors in the header area :\ Along with getting the familiar "Some problems were encountered. The requested (user|thread) could not be found." message.
  • lechlech Chicagoland
    If it's of any further use, the php/sql versions on the local are: PHP Version 5.2.0-8+etch1 and MySQL 5.0.32. so to some extent the servers do share the same MySQL version more or less give or take a couple of version numbers. I wonder if this could account for the meltdown I experienced on one of my installations with time warping.
  • I'm getting this error too with PHP Version 5.2.3: http://www.gridface.com/forum/comments.php?DiscussionID=220
  • Added to the bug-tracker.
This discussion has been closed.