Support Forum

Bug report: admin bar

BL Blaise
Blaise
Member

Hi,

The admin bar plugin generates a warning in the apache log when the admin clicks on the “See new messages” button.

The error:

PHP Warning – Invalid argument supplied for foreach() – file: /forum-plugins/admin-bar/library/sp-admin-bar-components.php – line: 402 – function: sp_NewPostListAdmin,

The error also appears in line 448.

 

I was able to fix the error by adding a check before both loops:

if (isset($topic[‘posts’])) {

….

 

I hope my fix can be integrated in future versions.

greetings

3 Answers

New Answer

SS SP Community Support
SP Community Support
Admin

Hi:

Is that error showing up when there are posts to be viewed or when there is nothing in the admin post bag?

Thanks.

BL Blaise
Blaise
Member

Hi,

The error is generated to my knowledge when a post has been deleted. Here is a screenshot of a correct display:

http://prntscr.com/rqabef

The Forum title (“discussion libre”) appears, but the next line (“Nettoyage de..”) is blank and instead of “There is 1 new message”… there is “There is new message” with no digits.

SS SP Community Support
SP Community Support
Admin

Ah, yeah, I can see that maybe if a post is deleted before the admin has had a chance to review it how that might present an issue.  The admin postbag queue might still contain a reference to the post.  I’ll add this as an issue in the issue tracker for a possible future fix.

Thanks for the report.