Page 1 of 1

OBBLM Roster PDF output not working

Posted: Thu Jul 28, 2016 3:12 pm
by pinkskink
Whenever anyone in my league tries to create a pdf of their roster we get a problem with the coding, (see image).

I googled the problem and came across a similar problem and it said add a code before this another, but that didn't work. Anyone else have this problem?
I am running the new NAFLM 1.0

Re: OBBLM Roster PDF output not working

Posted: Fri Jul 29, 2016 8:12 am
by Hegel
I also have problems with the PDF output, but I don´t get this error message. It only says "Error loading the PDF document" . Also NAFLM1.0 , in a test installation.

Re: OBBLM Roster PDF output not working

Posted: Fri Jul 29, 2016 9:37 am
by Vanguard
pinkskink wrote:Whenever anyone in my league tries to create a pdf of their roster we get a problem with the coding, (see image).

I googled the problem and came across a similar problem and it said add a code before this another, but that didn't work. Anyone else have this problem?
I am running the new NAFLM 1.0
Looks like the ob_clean() function call on line 994 is returning an error. As the error message has already been sent as output, the attempt to change the header on line 1018 is failing which prevents the PDF generation.
the ob_clean() function empties the current output buffer and the error message is reporting that it is already empty. Not sure why your install should be doing this when other don't but should be resolvable by using ob_get_length() to check if the buffer needs emptied first.

If you're comfortable with it, try replacing line 994 with:

Code: Select all

if (ob_get_length()) {
    ob_clean();
}
I'll add this to the GitHub but that might get you up and running in the short term. I've tested the code on my site and it doesn't cause me any errors, but I can't reproduce your error in the first place.

Re: OBBLM Roster PDF output not working

Posted: Fri Jul 29, 2016 6:54 pm
by Shteve0
This error is generally due to a space or line carry in the at the end of one of the php files - ie after the final ?>

Re: OBBLM Roster PDF output not working

Posted: Mon Aug 01, 2016 6:01 am
by Hegel
Hegel wrote:I also have problems with the PDF output, but I don´t get this error message. It only says "Error loading the PDF document" . Also NAFLM1.0 , in a test installation.
Some more details - screenshot.
Image

What I did :
created a fresh installation of NAFLM1.0 in a test webspace
imported the tables from an existing OBBLM 0.95 installation into the empty tables of the fresh installation

Almost everything works fine, except all PDF related stuff (roster, match report).

Re: OBBLM Roster PDF output not working

Posted: Mon Aug 01, 2016 8:57 am
by Shteve0
Does anyone have this error on a hosted site? I'm certain the issue is a space at the end of a file but without being able to see the page I'm shooting blind...

Re: OBBLM Roster PDF output not working

Posted: Mon Aug 01, 2016 10:48 am
by Hegel
Here´s the test site where the error occurs : http://munichrumbbl.esy.es/

If needed I could provide any access needed (user account for the obblm, ftp access, database access). Just tell me what you would need. Any help is welcome !

Re: OBBLM Roster PDF output not working

Posted: Mon Aug 01, 2016 2:50 pm
by rolo
When set to English, the error is "Failed to load PDF document"

Re: OBBLM Roster PDF output not working

Posted: Tue Aug 02, 2016 2:23 pm
by pinkskink
Vanguard wrote:
pinkskink wrote:Whenever anyone in my league tries to create a pdf of their roster we get a problem with the coding, (see image).

I googled the problem and came across a similar problem and it said add a code before this another, but that didn't work. Anyone else have this problem?
I am running the new NAFLM 1.0
Looks like the ob_clean() function call on line 994 is returning an error. As the error message has already been sent as output, the attempt to change the header on line 1018 is failing which prevents the PDF generation.
the ob_clean() function empties the current output buffer and the error message is reporting that it is already empty. Not sure why your install should be doing this when other don't but should be resolvable by using ob_get_length() to check if the buffer needs emptied first.

If you're comfortable with it, try replacing line 994 with:

Code: Select all

if (ob_get_length()) {
    ob_clean();
}
I'll add this to the GitHub but that might get you up and running in the short term. I've tested the code on my site and it doesn't cause me any errors, but I can't reproduce your error in the first place.

Just FYI, at this current moment in time. This code works for my problem. Thank you again, Shteve0

Re: OBBLM Roster PDF output not working

Posted: Wed Aug 03, 2016 10:12 am
by Hegel
rolo wrote:When set to English, the error is "Failed to load PDF document"
Problem is not code specific, it is site specific. Meaning, exported everything from website A, imported in website B and problem vanished.

Re: OBBLM Roster PDF output not working

Posted: Wed Aug 03, 2016 7:30 pm
by Shteve0
pinkskink wrote: Just FYI, at this current moment in time. This code works for my problem. Thank you again, Shteve0
You're welcome, but I think it's Vanguard who's earned your thanks :)

Re: OBBLM Roster PDF output not working

Posted: Tue Aug 09, 2016 2:45 pm
by Vanguard
Shteve0 wrote:
pinkskink wrote: Just FYI, at this current moment in time. This code works for my problem. Thank you again, Shteve0
You're welcome, but I think it's Vanguard who's earned your thanks :)
Ah, but you persuaded me to get involved in the first place, so the credit is all yours. :lol: