Forums / All Other Contributions/Addons / Keepalive Timer and Orders Exporter conflict

Keepalive Timer and Orders Exporter conflict

Views: 1,552

Results 1 to 9 of 9
16 Jul 2014, 10:33 PM
#1
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

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.php?193168-Orders-Exporter-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?

17 Jul 2014, 12:11 AM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

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

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

17 Jul 2014, 1:31 AM
#3
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

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
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.
23 Jul 2014, 3:14 AM
#4
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

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.php?75406-Export-Shipping-amp-Order-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.

29 Jul 2014, 5:18 AM
#5
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Keepalive Timer and Orders Exporter conflict

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.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

31 Jul 2014, 3:49 PM
#6
rixstix avatar

rixstix

Totally Zenned

Join Date:
Aug 2009
Location:
North Idaho, USA
Posts:
2,015
Plugin Contributions:
0

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.

Rick
RixStix (dot) com
aka: ChainWeavers (dot) com

31 Jul 2014, 3:59 PM
#7
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

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.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

31 Jul 2014, 8:21 PM
#8
rixstix avatar

rixstix

Totally Zenned

Join Date:
Aug 2009
Location:
North Idaho, USA
Posts:
2,015
Plugin Contributions:
0

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.

Rick
RixStix (dot) com
aka: ChainWeavers (dot) com

1 Aug 2014, 1:15 PM
#9
rixstix avatar

rixstix

Totally Zenned

Join Date:
Aug 2009
Location:
North Idaho, USA
Posts:
2,015
Plugin Contributions:
0

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

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

<?php require(DIR_WS_INCLUDES . 'keepalive_module.php'); ?>

OrdersExport and KeepAlive seem to be playing nice with each other.

Rick
RixStix (dot) com
aka: ChainWeavers (dot) com