Support Forum

SP error log – Trying to get property of non-object

TH Thorsten
Thorsten
Member

I’ve been keeping an eye on the SP error log since my recent issue and I am noticing the following re-occurring errors with three of the SP plug-ins:

file: cor8sh/public_html/eclasses/blog/wp-content/sp-resources/forum-plugins/admin-bar/library/sp-admin-bar-components.php
line: 520
function: sp_AdminBarDashboardPosts
Notice | Trying to get property of non-object

file: cor8sh/public_html/eclasses/blog/wp-content/sp-resources/forum-plugins/watches/template-tags/sp-watches-watch-button-tag.php
line: 54
function: sp_WatchesWatchButtonTag
Notice | Trying to get property of non-object

file: cor8sh/public_html/eclasses/blog/wp-content/sp-resources/forum-plugins/mentions/library/sp-mentions-components.php
line: 57
function: sp_mentions_do_new_post
Notice | Trying to get property of non-object

I don’t see any effects on the actual forum or decreased functionality but am still wondering what might be causing those errors (didn’t find any existing topic on this).

 

11 Answers

New Answer

YS Yellow Swordfish
Yellow Swordfish
Member

let’s start by asking if you are up to date with all the latest SP updates? Core AND plugins that is…
This still suggests that some data has been deleted somewhere along the line outside of the SP UI. But let’s look at these one at a time starting with the first one.

That notice suggests that your list of unread posts contains a topic ID that no longer exists. So – if you empty your personal unread post list does it reset itself to zero? And if it does – does that stop the notice being recorded?

TH Thorsten
Thorsten
Member

Yes, I am up to date on SP core and all plugins I am using.

I also just reset my unread posts. At first it would not clear all of them but kept showing 13 as still unread, no matter how often I clicked ‘Mark All Topics As Read’. Once I emptied the admin postbag I was able to reset to 0. Will keep an eye on the error log and post feedback soon.

YS Yellow Swordfish
Yellow Swordfish
Member

Do you actually use the admin bar and the postbag? It is one of those things that if not used is best always left inactive. If it builds up to a long list it can slow performance for admins and moderators.

So yes – let’s see if this one goes away before moving on please…

TH Thorsten
Thorsten
Member

Yes, I use the admin bar and postbag. I check messages several times a day right on the forum page and clear the postbag frequently. I find it to be a great admin tool, wouldn’t want to miss it.

Unfortunately the previous steps did not resolve the issue, still seeing the same error messages.

TH Thorsten
Thorsten
Member

Edited. Thought admin bar error had been resolved. But as of 20 minutes ago it re-appeared.

 

MP Mr Papa
Mr Papa
Member

admin bar error?  can you clarify?  or do you mean the notice from post #1??  a notice is not an error… just a nuisance…  like Andy though, unsure why you are getting it…

and you are only getting the notice on line 520?  not one also on 519?  if the topic did not exist, seems like both lines would throw a notice…

the watches notice is weird too.. also seems to imply you have a topic with no post…  not sure how that can happen…

your mentions one is odd too…  that line of code does not match the currently released plugin… earlier we asked if all your sp plugins were up to date…  but does not appear to be the case… mentions should be version 1.0.1… can you verify you have that version? 

TH Thorsten
Thorsten
Member

I mean the notice from post #1. Since it’s captured in errorlog I refer to it as an error though yes, it is declared a notice.

I can confirm that there is a notice for line 519 and 520 for admin bar.

So these notices indicate a topic without posts? We run this forum an our eCourse website. We run eCourses twice a year, 4 week duration with a 4 week extended access to the forum. After that we clear out the forum. Some topics are kept with just the initial posts by my wife and I for future courses. To clean these topics I use the move post feature and move the first non-admin post of those topics as well as all following posts to a dump topic for deletion (as it would otherwise be too time consuming to delete and rebuild the entire topics). Though I have not come across any issues doing this. But perhaps something went awry along the way during our last clean-up?

Note: out of curiosity went into phpmyadmin, pulled wp_sftopics and sorted by post_count. All topics have at least 1 post count.

Also, verified that mentions plugin is version 1.0.1.

MP Mr Papa
Mr Papa
Member

so since both 519 and 520, that says you have a topic in your admin bar that does not exist (as Andy suggested – I thought otherwise based on only 520 comment)…  did you moderate any topics and delete theme from admin bar perhaps?

so in mentions file where you see the notice, what do you have for line 57? that should be:

    foreach ($names as $name) {

which wouldnt generate that notice…

MP Mr Papa
Mr Papa
Member

but I could understand the potential for lin 59:

        $id = $user->ID;

TH Thorsten
Thorsten
Member

No topics on our forum that require moderation, all are open as only registered users can access the forum. Usually I only check the admin postbag to see if there are new topics for me under tech support, then clear it out.

Concerning Mentions, interestingly line 57 in my sp-mentions-components.php is:

        $id = $user->ID;

foreach ($names as $name) { is on line 55

Note: I just downloaded Mentions again and pulled up the file in question. Line 57 shows $id = $user->ID; there as well.

MP Mr Papa
Mr Papa
Member

you might be missing an svn properties change done on the file since release??? still a bit unsure how you would get that… but at least the line makes sense… perhaps a user tried to do a mention with the wrong name… there is a check for that, but should make sure the object exists…

again, its a notice and causes no harm… but will get that particular one cleaned up in next version…