OBBLM Roster PDF output not working

However you play online - Java, Vassal, Email, Cyanide etc - talk about it here.
This is also the place for discussing the various tools for managing leagues, teams and so on.

Moderator: TFF Mods

Post Reply
pinkskink
Rookie
Rookie
Posts: 22
Joined: Fri Jun 03, 2016 3:33 pm

OBBLM Roster PDF output not working

Post 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
You do not have the required permissions to view the files attached to this post.

Reason: ''
Hegel
Experienced
Experienced
Posts: 150
Joined: Mon Jan 30, 2012 8:19 am

Re: OBBLM Roster PDF output not working

Post 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.

Reason: ''
User avatar
Vanguard
Super Star
Super Star
Posts: 922
Joined: Sun Jun 08, 2008 8:27 am
Location: Glasgow
Contact:

Re: OBBLM Roster PDF output not working

Post 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.

Reason: ''
User avatar
Shteve0
Legend
Legend
Posts: 2479
Joined: Thu May 07, 2009 10:15 am
Location: Wellington, New Zealand

Re: OBBLM Roster PDF output not working

Post 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 ?>

Reason: ''
League and tournament hosting, blogging and individual forums - all totally free. For the most immersive tabletop sports community experience around, check out theendzone.co
Hegel
Experienced
Experienced
Posts: 150
Joined: Mon Jan 30, 2012 8:19 am

Re: OBBLM Roster PDF output not working

Post 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).

Reason: ''
User avatar
Shteve0
Legend
Legend
Posts: 2479
Joined: Thu May 07, 2009 10:15 am
Location: Wellington, New Zealand

Re: OBBLM Roster PDF output not working

Post 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...

Reason: ''
League and tournament hosting, blogging and individual forums - all totally free. For the most immersive tabletop sports community experience around, check out theendzone.co
Hegel
Experienced
Experienced
Posts: 150
Joined: Mon Jan 30, 2012 8:19 am

Re: OBBLM Roster PDF output not working

Post 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 !

Reason: ''
User avatar
rolo
Super Star
Super Star
Posts: 1188
Joined: Wed May 27, 2015 9:38 am
Location: Paradise Stadium, where the pitch is green and the cheerleaders are pretty.

Re: OBBLM Roster PDF output not working

Post by rolo »

When set to English, the error is "Failed to load PDF document"

Reason: ''
"It's 2+ and I have a reroll. Chill out. I've got this!"
Image
pinkskink
Rookie
Rookie
Posts: 22
Joined: Fri Jun 03, 2016 3:33 pm

Re: OBBLM Roster PDF output not working

Post 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

Reason: ''
Hegel
Experienced
Experienced
Posts: 150
Joined: Mon Jan 30, 2012 8:19 am

Re: OBBLM Roster PDF output not working

Post 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.

Reason: ''
User avatar
Shteve0
Legend
Legend
Posts: 2479
Joined: Thu May 07, 2009 10:15 am
Location: Wellington, New Zealand

Re: OBBLM Roster PDF output not working

Post 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 :)

Reason: ''
League and tournament hosting, blogging and individual forums - all totally free. For the most immersive tabletop sports community experience around, check out theendzone.co
User avatar
Vanguard
Super Star
Super Star
Posts: 922
Joined: Sun Jun 08, 2008 8:27 am
Location: Glasgow
Contact:

Re: OBBLM Roster PDF output not working

Post 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:

Reason: ''
Post Reply