Support Forum

Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
plugins-topic
Bug report: admin bar
Avatar
Blaise
Member
Pro Subscribers
Offline
Mar 24, 2020 - 9:56 am

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

Avatar
SP Community Support
SP Moderator
Offline
Mar 25, 2020 - 1:11 pm

Hi:

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

Thanks.

Avatar
Blaise
Member
Pro Subscribers
Offline
Mar 31, 2020 - 12:35 pm

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.

Avatar
SP Community Support
SP Moderator
Offline
Mar 31, 2020 - 1:15 pm

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.

Forum Timezone: Europe/Stockholm
Most Users Ever Online: 1170
Currently Online:
Guest(s) 1
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Mr Papa: 19448
Ike: 2086
Brandon: 864
kvr28: 804
jim: 650
FidoSysop: 577
Conrad_Farlow: 531
fiddlerman: 358
Stefano Prete: 325
Member Stats:
Guest Posters: 619
Members: 17364
Moderators: 0
Admins: 4
Forum Stats:
Groups: 7
Forums: 17
Topics: 10127
Posts: 79625