Guest hafree Posted December 10, 2006 Share Posted December 10, 2006 I recently upgraded from 3.0.12 to 3.0.14, and found that the USPS shipping module was completely broken. The error message recieved when a user attempts to proceed to step 4 of the checkout process is: Failed to add the package With debugging enabled, the error messages I saw were: USPS ERROR: Package array was empty. or USPS ERROR: Container not recognised. Here's the problem: the following files changed from 3.0.13 to 3.0.14, but were not updated in the distribution, except for the version in the headers: admin\modules\shipping\USPS\index.php modules\shipping\USPS\calc.php I was able to fix them by stepping through the changelogs, and now everything works correctly once again. I'm glad it wasn't anything major, but it's a shame that this minor upgrade took countless hours longer than it should have because of sloppy packaging of the new distribution. Hopefully this problem doesn't affect any other modules. Quote Link to comment Share on other sites More sharing options...
Guest pbrcaptain Posted December 11, 2006 Share Posted December 11, 2006 I just upgraded to 3.0.14 and am getting the "USPS ERROR: Package array was empty" error. Since I'm new at this, I'm not sure what you fixed and how you did it. Is there somewhere I can get the right versions of the admin\modules\shipping\USPS\index.php and modules\shipping\USPS\calc.php files? Thanks!! Quote Link to comment Share on other sites More sharing options...
Guest hafree Posted December 11, 2006 Share Posted December 11, 2006 Here are the correct files for 3.0.14. index.phpcalc.php Quote Link to comment Share on other sites More sharing options...
Guest pbrcaptain Posted December 12, 2006 Share Posted December 12, 2006 Here are the correct files for 3.0.14. index.phpcalc.php Thank you! That did the trick!! Just a side note: I did have to go back and make a mod to modules\shipping\USPS\calc.php to fix the USPS zipcode plus problem mentioned elsewhere in this Forum. Thanks again - I appreciate you responding so quickly!! Quote Link to comment Share on other sites More sharing options...
markscarts Posted December 14, 2006 Share Posted December 14, 2006 @hafree, thank you for sharing the files, will save time for me :rolleyes: Quote Link to comment Share on other sites More sharing options...
Turtleman Posted December 17, 2006 Share Posted December 17, 2006 Seems a number of users have the same issue, Mark fixed mine on the customers side, but now I have the same problem on the Admin Side; "Admin>>Shipping>>Configure>>Edit Settings" ,, gives the same Error Security Warning Parsed array keys can not contain illegal characters! Script execution has been halted. It may be possible to fix this error by deleting your browsers cookies and refresh this page. I'm cant enable or disable any settings.. any step by step instructions on how to get our cart to work again?? All Products are now defulted as "Free Shipping" and I cant change it or turn it off!! This is a real BAD thing! Quote Link to comment Share on other sites More sharing options...
Turtleman Posted December 17, 2006 Share Posted December 17, 2006 Thank You CC Support... I guess thats the reason users should use the top up support thats offered The errors you have are because you haven't updated your store properly. I can see the code in /modules/shipping/USPS/calc.php as: if(ereg("service_",$moduleKey) && $moduleValue==1){ $moduleKey = str_replace("service_","",$moduleKey); In 3.0.14 it is: if(ereg("service",$moduleKey) && $moduleValue==1){ $moduleKey = str_replace("service","",$moduleKey); The _ is the source of your problems as it is a potentially dangerous charachter in array keys. Quote Link to comment Share on other sites More sharing options...
Guest pbrcaptain Posted December 19, 2006 Share Posted December 19, 2006 Thank You CC Support... I guess thats the reason users should use the top up support thats offered The errors you have are because you haven't updated your store properly. I can see the code in /modules/shipping/USPS/calc.php as: if(ereg("service_",$moduleKey) && $moduleValue==1){ $moduleKey = str_replace("service_","",$moduleKey); In 3.0.14 it is: if(ereg("service",$moduleKey) && $moduleValue==1){ $moduleKey = str_replace("service","",$moduleKey); The _ is the source of your problems as it is a potentially dangerous charachter in array keys. Do all 3 of these below need to be edited like this example to solve this problem? foreach($module as $moduleKey => $moduleValue){ //Changed from "service_" to "service" if(ereg("service",$moduleKey) && $moduleValue==1){ //Changed from "service_" to "service" $moduleKey = str_replace("service","",$moduleKey); // only proceed if module is enabled //Changed from "service_" to "service" if($module["service".$moduleKey]==1){ switch($moduleKey) { Quote Link to comment Share on other sites More sharing options...
Guest pbrcaptain Posted December 19, 2006 Share Posted December 19, 2006 Thank You CC Support... I guess thats the reason users should use the top up support thats offered The errors you have are because you haven't updated your store properly. I can see the code in /modules/shipping/USPS/calc.php as: if(ereg("service_",$moduleKey) && $moduleValue==1){ $moduleKey = str_replace("service_","",$moduleKey); In 3.0.14 it is: if(ereg("service",$moduleKey) && $moduleValue==1){ $moduleKey = str_replace("service","",$moduleKey); The _ is the source of your problems as it is a potentially dangerous charachter in array keys. Do all 3 of these below need to be edited like this example to solve this problem? foreach($module as $moduleKey => $moduleValue){ //Changed from "service_" to "service" if(ereg("service",$moduleKey) && $moduleValue==1){ //Changed from "service_" to "service" $moduleKey = str_replace("service","",$moduleKey); // only proceed if module is enabled //Changed from "service_" to "service" if($module["service".$moduleKey]==1){ switch($moduleKey) { As a side note: I've made the changes above and tried the last line with "service" and "service_" and I still get the following error on the admin side!! HELP!!! Security Warning Parsed array keys can not contain illegal characters! Script execution has been halted. It may be possible to fix this error by deleting your browsers cookies and refresh this page. Quote Link to comment Share on other sites More sharing options...
Turtleman Posted December 19, 2006 Share Posted December 19, 2006 I honestly wish I knew codeing better.. both Mark at CC3.biz and myself tried about everything and kept chaseing errors from the back end to the front end... I ended up opening a ticket at the support desk and after those fixes didnt work they just went in and fixed it themselves.......(I think they got tired of me)..LOL in WinMerge the only difference in the calc file was; if(ereg("service_",$moduleKey) && $moduleValue==1){ // }elseif(ereg("service",$moduleKey) && $moduleValue==1){ I dont know what else in any other files they changed,, I'll take a look when I get back from work later today.. Personally the best thing I can think of doing is just paying for the support.. its really cheap considering the time we spend trying to figure this stuff out.. Quote Link to comment Share on other sites More sharing options...
Guest Posted December 19, 2006 Share Posted December 19, 2006 Here are the correct files for 3.0.14. index.phpcalc.php I just uploaded these files to my installation, yet I still get the same errors. Any clues as to why? Quote Link to comment Share on other sites More sharing options...
Guest Posted December 19, 2006 Share Posted December 19, 2006 Thank You CC Support... I guess thats the reason users should use the top up support thats offered The errors you have are because you haven't updated your store properly. I can see the code in /modules/shipping/USPS/calc.php as: if(ereg("service_",$moduleKey) && $moduleValue==1){ $moduleKey = str_replace("service_","",$moduleKey); In 3.0.14 it is: if(ereg("service",$moduleKey) && $moduleValue==1){ $moduleKey = str_replace("service","",$moduleKey); The _ is the source of your problems as it is a potentially dangerous charachter in array keys. Making this change in the calc.php file given above fixed my store, and restoring my original admin/modules/shipping/USPS/index.php file got rid of the security warning message (which, btw, I've been getting in other areas of my store - more or less randomly, as closing my browser and trying again has always fixed the issue [i'm using FF on a Linux machine]). Thanks guys for pointing out this problem. I rarely sell physical products, so I didn't know about the problem until I saw this thread. Quote Link to comment Share on other sites More sharing options...
Guest hafree Posted December 19, 2006 Share Posted December 19, 2006 Thanks guys for pointing out this problem. I rarely sell physical products, so I didn't know about the problem until I saw this thread. And thanks for your fixes to the USPS shipping module! My store wouldn't be functional without them. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.