Page 1 of 1

Pilot Roster Tool - Save button not appearing

Posted: Wed 05 Jan 2011 6:43 pm
by 62_Anubis
First of all, hi to all and tell the developers that it´s an incredible work what you are doing with SEOW... takes IL-2 far beyond what we ever expected.

Now concerning to this post, I´m having a problem with the Pilot Roster tool. I´ve manually dropped the table in the database because I´ve read in the source code of the php that if not present, it´s created again. So far so good... table is indeed created with no problem.
But when I make a change and try to add a pilot, I get an error in the status bar of Internet Explorer. I´ve loaded the page into Chrome debbuger and the problem seems to be in this function:

function glowButtons() {

if (PlayerAuthority!="READONLY"){

document.getElementById('Save').style.visibility = "visible";

}

The error message is as follows:

MP-PilotRoster.php: 163 Uncaught TypeError: Cannot read property 'style' of null

Any ideas on how to solve this?

I´m using Apache 2.2.17 and PHP 5.3.4
Running on Windows 7 64bits

Thanks in advance

Posted: Wed 05 Jan 2011 9:47 pm
by IV/JG7_4Shades
Hi Anubis,

Welcome, and thanks for the kind words. We think we have a credible combined-ops campaign tool for IL-2 here. :)

I was able to reproduce your bug! It was some bad Javascript that did not correctly employ the id property for the Save and Refresh buttons. Here is the corrected code in MP-PilotRoster.php:

Code: Select all

HTMLcontents += '<form name="RosterForm" method="post" action="'+thisPage+'"><span class="small">'+
				'<input type="button" name="Save" id="Save" value="Save" title="Save Roster Changes" onClick="javascript:submitPOST(\'SAVE\');" style="background:#dfdf44; font-family:sans-serif; font-size:11px; height:19px; color: <?php echo SkinText();?>; visibility:hidden;">&nbsp;&nbsp;'+
				'<input type="button" name="Refresh" id="Refresh" value="Refresh" title="Reload Stored Roster" onClick="javascript:submitPOST(\'REFRESH\');" style="background:#dfdf44; font-family:sans-serif; font-size:11px; height:19px; color: <?php echo SkinText();?>; visibility:hidden;">'+
				'<table width="785px" cellpadding="3" cellspacing="2" border="0" bgcolor="#D9D9D9">';
The id="Save" and id="Refresh" assignments were missing. This causes an error in IE8's more standards-compliant DOM, but IE7 and IE6 are much more lenient.

If you don't feel like making this code change, you can simply switch IE8 into compatibility mode and the original page will work.

Many thanks for the bug report!

Cheers,
4S

Posted: Wed 05 Jan 2011 10:21 pm
by IV/JG7_4Shades
Oh, and don't forget to use SEDB32G as your database revision. It contains a completely revised set of data for roads and railways, so should give much better ground war performance in some sectors.

Cheers,
4Shades

Posted: Thu 06 Jan 2011 4:36 am
by 62_Anubis
Solved!

Many thanks 4Shades! I´ve edited the code and it´s working perfect now. I had been around the Roster tool for few days wondering why the buttons didn´t appear and I was thinking that maybe I was doing something wrong until I saw the tiny error message in IE8.

Once again many thanks for your quick response.

Anubis

Posted: Fri 07 Jan 2011 5:00 am
by 62_Anubis
Hi Shades, it´s me again.

The button not appearing is solved, thanks a lot.. but something strange is happening I think.
I open 2 different sessions to MP, and I log as Axis in one and as Allied in the second. After this I create a flight mission for Allied and go to Roster Tool and type the name of a pilot and then click "Save" and it´s successfully stored in the DB. Then I go to Axis side and do the same, and when I save another pilot, and check again the DBase, the one that I saved as Allied is gone.

So I can have only 1 pilot in the roster because when I add one of the opposite side, the first one seems to be deleted.

Am I doing something wrong

Have the latest release of MP.

Thanks again in advance

Posted: Fri 07 Jan 2011 5:32 am
by IV/JG7_4Shades
Hi Anubis,

Download MP-PilotRoster.php from the CVS tree - this error is fixed now. :)

Cheers,
4Shades