Forums | Mahara Community
Support
/
Posting pinboard message failed
29 March 2009, 17:16
Hi! I wanted to write a pinboard message. Something unaccountable happend:
blocktype/wall/post.php --> ERROR - something bad happened after headers have been sent. Check the error log for more information.
I can't understand why. Do you have an idea?
29 March 2009, 21:29
Hi - as the message says, check the error logs . This is your apache vhost error log - Mahara puts detailed messages in there.
It's likely that you've customised a file and accidentally caused some whitespace to be output to the browser before Mahara was ready for it. The error log will tell you what line this happened on.
30 March 2009, 1:43
Hi,
I see on my host the same error.
Here is the stuff from the errorlog:
[30-Mär-2009 01:40:24] [WAR] de (lib/errors.php:396) An exception was thrown of class Exception.
[30-Mär-2009 01:40:24] [WAR] de (lib/errors.php:396) THIS IS BAD and should be changed to something extending MaharaException,
[30-Mär-2009 01:40:24] [WAR] de (lib/errors.php:396) unless the exception is from a third party library.
[30-Mär-2009 01:40:24] [WAR] de (lib/errors.php:396) Original trace follows
[30-Mär-2009 01:40:24] [WAR] de (lib/web.php:1905) Headers already sent when redirect() was called
[30-Mär-2009 01:40:24] Call stack (most recent first):
[30-Mär-2009 01:40:24] * redirect() at /home/h1moodle/public_html/mahara/blocktype/wall/lib.php:142
[30-Mär-2009 01:40:24] * PluginBlocktypeWall::wallpost_submit("/user/view.php?id=1") at /home/h1moodle/public_html/mahara/lib/pieforms/pieform.php:430
[30-Mär-2009 01:40:24] * Pieform->__construct(object(Pieform), array(size 6)) at /home/h1moodle/public_html/mahara/lib/pieforms/pieform.php:170
[30-Mär-2009 01:40:24] * Pieform::process(array(size 2), array(size 2)) at /home/h1moodle/public_html/mahara/lib/pieforms/pieform.php:71
[30-Mär-2009 01:40:24] * pieform() at /home/h1moodle/public_html/mahara/blocktype/wall/lib.php:125
[30-Mär-2009 01:40:24] * PluginBlocktypeWall::wallpost_form(array(size 8)) at /home/h1moodle/public_html/mahara/blocktype/wall/post.php:38
[30-Mär-2009 01:40:24]
Any idea?
30 March 2009, 4:17
Hi Nigel! I'm using a Textpad encoding in UTF-8. This is why I don't understand the thing. Should I save the files with ANSI, Unicode, ...? Do you recommend an editor (for windows), where you can impose errors?
30 March 2009, 4:58
Hi Nigel! Ad-On: Is it possible to use "php_strip_whitespace()" or something similar within MAHARA in general to avoid future problems with nonessential generated white spaces?30 March 2009, 11:00
By the way: My error-log shows:
[WAR] 16 (lib/errors.php:396) An exception was thrown of class Exception. , referer: http://www.tourismtalents.org//user/view.php?id=1[WAR] 16 (lib/errors.php:396) THIS IS BAD and should be changed to something extending MaharaException,, referer: http://www.tourismtalents.org//user/view.php?id=1
[WAR] 16 (lib/errors.php:396) unless the exception is from a third party library., referer: http://www.tourismtalents.org//user/view.php?id=1
[WAR] 16 (lib/errors.php:396) Original trace follows, referer: http://www.tourismtalents.org//user/view.php?id=1
[WAR] 16 (lib/web.php:1905) Headers already sent when redirect() was called, referer: http://www.tourismtalents.org//user/view.php?id=1
Call stack (most recent first):, referer: http://www.tourismtalents.org//user/view.php?id=1
* redirect() at /home/www/web31/html/mahara/htdocs/blocktype/wall/lib.php:142, referer: http://www.tourismtalents.org//user/view.php?id=1
* PluginBlocktypeWall::wallpost_submit("/user/view.php?id=1") at /home/www/web31/html/mahara/htdocs/lib/pieforms/pieform.php:430, referer: http://www.tourismtalents.org//user/view.php?id=1
* Pieform->__construct(object(Pieform), array(size 6)) at /home/www/web31/html/mahara/htdocs/lib/pieforms/pieform.php:170, referer: http://www.tourismtalents.org//user/view.php?id=1
* Pieform::process(array(size 2), array(size 2)) at /home/www/web31/html/mahara/htdocs/lib/pieforms/pieform.php:71, referer: http://www.tourismtalents.org//user/view.php?id=1
* pieform() at /home/www/web31/html/mahara/htdocs/blocktype/wall/lib.php:125, referer: http://www.tourismtalents.org//user/view.php?id=1
* PluginBlocktypeWall::wallpost_form(array(size 8)) at /home/www/web31/html/mahara/htdocs/blocktype/wall/post.php:38, referer: http://www.tourismtalents.org//user/view.php?id=1
, referer: http://www.tourismtalents.org//user/view.php?id=1
30 March 2009, 17:33
Hi - I doubt we would do this, as it makes the code nigh on impossible to read, which goes against Mahara being an easily hackable system . In any case, the error this time was caused in the German langpack, so even if we were doing this we couldn't have prevented this issue.
The little patch I made to redirect() will make it easier to find these errors in future, at least.
30 March 2009, 17:30
Hi guys - Heinz and I found the problem, the German language pack had a file with extra whitespace at the end of it, which is why you guys were both seeing the problem and I couldn't initially
I have added a small patch to output _where_ the output started in the error log, so these problems should be easier to find in future.
31 March 2009, 2:55
Hi Nigel,
thanks for the fast bug-hunting
I will check the files for such stupid chars right now.