MyBB Community Forums

Full Version: Fatal error when viewing announcements
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
My site is running MyBB 1.2.14 (with all available manual patches done to it) and every time I try to view announcements I get the following fatal error:

Fatal error: Call to undefined method MyLanguage::sprintf() in /home2/kaleycuo/public_html/forum/announcements.php on line 84

I of course checked the code and everything is correct. Can somebody tell me how to fix this?
And have you tried just reuploading that file and seeing if it fixes it??
Yes, I did that. I just did it again. But it didn't change anything.
maybe its time to upgrade friend Wink
Line 84:

$lang->forum_announcement = sprintf($lang->forum_announcement, $announcementarray['subject']);

Have you edited any language files??
sounds like he could have edited that file
(2009-01-15, 04:51 PM)Proper Wrote: [ -> ]maybe its time to upgrade friend Wink

Is this supposed to be helpful? Just wondering.

Anyway, I didn't edit any language files. The only edits I would have made to language files would have been made through the admin CP. I NEVER edit files by hand unless instructed to manually patch them. And then I still have backups and double check.

What language file are you talking about?

MattR Wrote:$lang->forum_announcement = sprintf($lang->forum_announcement, $announcementarray['subject']);

According to the 1.4.2 to 1.4.3 patch users of 1.2.14 had to change that line of code to this:

$lang->forum_announcement = $lang->sprintf($lang->forum_announcement, htmlspecialchars_uni($announcementarray['subject']));

And that's exactly what I did. I of course tried reverting the code back to Matt's code but that didn't solve anything. I just don't know where to look, so if you guys can steer me in the right direction that's greatly appreciated.
upgrading would be good though, and he is talking about the announcement language file i think
Well, the error references line 84 of announcements.php, and line 84 of announcements.php references this line of announcements.lang.php:

$l['forum_announcement'] = "Forum Announcement: {1}";

So, make sure it's set out like that.

And yes, upgrading from 1.2 is always recommended even if a forum is running fine.
@Matt: The line in my language file is exactly like you say it should be.

And yeah, I'm about to upgrade, but I just wanna know what's causing this. I checked all those files but I can't find anything that's wrong.

Even my host has no idea Sad What's with the sprintf thing? Could it be causing it?
Pages: 1 2