Keepalive Timer and Orders Exporter conflict
I have been upgrading the Orders Exporter mod and have it working perfectly in a stock v1.5.1 XAMPP environment, but a tester who also has the Keepalive Timer installed has run into a bug.
When doing a download (but not a "save to /oexport/" file), the Keepalive code is prepended to the output file.
http://www.zen-cart.com/showthread.p...xporter-Module (starting at post #40).
This happens with both the old version (1.6) of Orders Exporter and the new version (attached at post #38 of that thread). The undesired output occurs in both a v1.5.1 and a v1.5.3 test setup, but not in a v1.3.9 production site (which presumably does not have the keepalive timer).
Is this caused by antiquated download creation code in OEX (unchanged since 2008, and possibly since 2005), or by some quirk of the Keepalive code? What is the best way to resolve it?
Re: Keepalive Timer and Orders Exporter conflict
No, there's nothing in the keepalive-timer plugin that would inject itself unexpectedly.
It's only triggered by the code in /admin/includes/header.php, which is loaded via <?php require(DIR_WS_INCLUDES . 'header.php'); ?>
So, unless your plugin has an extra ill-placed call to header.php (which also loads the nav menu), I can't see why it would output any of the HTML for the keepalive script.
Either that, or you've got something else that's loading keepalive.php unexpectedly.
I just installed OEX from the link you posted and KeepaliveTimer from the plugins area, and they're working happily independently of one another (at least when doing an All Orders Export, both to screen and to file).
Re: Keepalive Timer and Orders Exporter conflict
Hmm... the main file, when a download is selected by recalling itself with appropriate parameters, processes and downloads the export file, then dies, before any HTML output is reached, let alone the require header.php.
PHP Code:
if ($mat_dlmethod == 'stream'){
// STREAM FILE
header("Content-type: application/vnd.ms-excel");
header("Content-disposition: attachment; filename=$EXPORT_TIME.txt");
// Changed if using SSL, helps prevent program delay/timeout (add to backup.php also)
if ($request_type== 'NONSSL'){
header("Pragma: no-cache");
} else {
header("Pragma: ");
}
header("Expires: 0");
echo $filestring;
die();
} else { //$mat_dlmethod == 'tempfile'
// SAVE FILE IN OEXPORT DIR
I will have to confer with my tester for more detail on his setup.
Re: Keepalive Timer and Orders Exporter conflict
I came across a report of Keepalive Timer interfering in the same way with a different order export mod by econcepts: (post 397)
http://www.zen-cart.com/showthread.p...er-Information
When the Keepaive timer is installed in my v1.5.1 XAMPP test site, I get a blank page after login until I specifically go to /myadmin/index.php, an issue also reported by Rixstix which he says is abated when he applies a file modified in some unknown way by Ajeh. After Keepalive installation, I do not get the code inserted in the downloaded file, but the file outputs as text directly to screen instead of downloading as it did previously.
I notice that you mentioned "to screen and to file", when what appears onscreen is supposed to be downloaded while the Orders Export admin page remains unchanged onscreen.
Re: Keepalive Timer and Orders Exporter conflict
Quote:
Originally Posted by
gjh42
After Keepalive installation, I do not get the code inserted in the downloaded file, but the file outputs as text directly to screen instead of downloading as it did previously.
I notice that you mentioned "to screen and to file", when what appears onscreen is supposed to be downloaded while the Orders Export admin page remains unchanged onscreen.
By "to screen and to file" I meant that I tested both types of output from the module ... as there are two columns of possible output choices, one for to-screen and one for to-file.
I also observed identical behavior with and without the Keepalive module installed.
A moment ago I noted that RixStix is engaged in discussion in another thread where odd symptoms are occurring because he (or maybe it's only others in that thread) is using PHP in FastCGI mode.
I did not test your Order Exporter in FastCGI mode.
Re: Keepalive Timer and Orders Exporter conflict
DrByte,
Did you use your version of keepalive or the current Numinix version available in plugins? (maybe the difference is inconsequential)
The plugin instructions say to modify one file as listed in the instructions, but I didn't see a file listed, nor edit to be made.
INSTALLATION IS SIMPLE: 1. Unzip and upload the files. 2. Make a small addition to one existing file. See the enclosed Instructions.txt file.
Now that I am back from a weeklong trip, I can use a vanilla 1.5.3 install for a test.
Re: Keepalive Timer and Orders Exporter conflict
Haven't used the numinix one. I just looked at it, and they butchered the documentation and their code changes will break on v1.5.2, v1.5.3, and newer. Don't use it.
Re: Keepalive Timer and Orders Exporter conflict
TNX DrByte,
I would have sworn that it was labeled for 1.5.2 & 1.5.3. Doesn't make much sense for the current version to be a downgrade from previous. That just reminded me why I have avoided Numinix modules in the past.
I'll try your version later today or tomorrow with Glenn's order export RC. Still playing catchup after being out of town for a week.
Re: Keepalive Timer and Orders Exporter conflict
Removed the numinix version. Installed the previous DrByte version.
Since v1.5.3 code in /admin/includes/header.php has this line second from the bottom
Code:
<?php if (file_exists(DIR_WS_INCLUDES . 'keepalive_module.php')) require(DIR_WS_INCLUDES . 'keepalive_module.php'); ?>
I did not add this line as listed in step2 of the keepalive instructions
Code:
<?php require(DIR_WS_INCLUDES . 'keepalive_module.php'); ?>
OrdersExport and KeepAlive seem to be playing nice with each other.