Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Payment Module Problem


kezza01

Recommended Posts

Hello Everybody,

 

I have a really weird problem and don't know the solution, that's why I will ask you for some help. I have tried to find a solution on this board, but without any results :(

 

When I change a setting in by example the paypal module, and then save the settings by pressing the update button, nothing will be saved.

 

I hope somebody can help me!

 

Gr. Kezza! :)

Link to comment
Share on other sites

Make sure that permissions on all your folders are set to 755, with permissions of 644 for all files - except for the two configure.php files, which can be either 644, 444 or 400 - depending on server setup.

 

Vger

Link to comment
Share on other sites

I was having the same problem!

 

The update of any payment or shipping module attributes failed. I could see the attibutes in the database and edit them manually with phpmyadmin but no changes were saved if I hit the update button in the admin tool.

 

I figured it had to be a bug or error in the admin tool itself rather than the module and with a little poking I found the problem is with a line in the /catalog/admin/modules.php file.

 

the line :

while (list($key, $value) = each($HTTP_POST_VARS['configuration'])) {

does not execute on my system, even tho' the syntax looks correct to me!

 

I simply commented that line out and replaced it with the simple line:

 

foreach ($HTTP_POST_VARS['configuration'] as $key => $value){

 

which is a much easier way of doing the exact same thing the original line is supposed to do.

 

then all was fine.

 

 

Hope this helps as I searched then net for a solution and found nada!

 

 

Cheers,

Brett

Link to comment
Share on other sites

I was having the same problem!

 

The update of any payment or shipping module attributes failed. I could see the attibutes in the database and edit them manually with phpmyadmin but no changes were saved if I hit the update button in the admin tool.

 

I figured it had to be a bug or error in the admin tool itself rather than the module and with a little poking I found the problem is with a line in the /catalog/admin/modules.php file.

 

the line :

while (list($key, $value) = each($HTTP_POST_VARS['configuration'])) {

does not execute on my system, even tho' the syntax looks correct to me!

 

I simply commented that line out and replaced it with the simple line:

 

foreach ($HTTP_POST_VARS['configuration'] as $key => $value){

 

which is a much easier way of doing the exact same thing the original line is supposed to do.

 

then all was fine.

Hope this helps as I searched then net for a solution and found nada!

Cheers,

Brett

 

Thank you So Much, it Works! :D :D

 

Gr. Kezza!

Link to comment
Share on other sites

Thanks, this also solved my problem! Wonderful! :thumbsup: :thumbsup:

Other great Open Source (Free) programs: (Free as in free speech not free beer)

The Gimp - An image program. | Firefox - All you have to do is add the Web Developer add-on to make this web browser complete. | FileZilla - An ftp program. | Inkscape - A good program to create images with. | Thunderbird - An email program. | Openoffice.org - An office suite that is compatible with MS Office. | Abiword - Another office suite. | Audacity - A sound recording tool. | ddp's Picks | Wordpress - An easy to use blogging software. | Joomla - An easy to use CMS that has ecommerce plug-ins. | Drupal - Another CMS

How do I find these programs? Google Search!

Link to comment
Share on other sites

I just spent hours trouble shooting to figure out what I was doing wrong... I actually even uninstalled and reinstalled the cart several times ect... I should have just came here LOL Thanks sooooo much! This solution worked!!!... I do have a question tho... not important but my curiousity is killing me...

 

 

I DLed ONE copy of osCommerse... I installed on my site... and using the same files, I also installed it on a friends site as well (right after mine was done - same day). However, I ran into this problem but she did not. How could that be possible?

 

Thanks Brett!!!!!!!!!!!!!!!!!!!!!!!!!!!

 

Always, Bree

Link to comment
Share on other sites

the line :

while (list($key, $value) = each($HTTP_POST_VARS['configuration'])) {

does not execute on my system, even tho' the syntax looks correct to me!

 

I simply commented that line out and replaced it with the simple line:

 

foreach ($HTTP_POST_VARS['configuration'] as $key => $value){

 

If the original way of doing things was correct, then the correct way to fix this is to add this line before the while loop:

 

reset($HTTP_POST_VARS['configuration']);

 

But hey, as long as it works it doesn't really matter. :D

 

Quick question: did this surface after applying STS 4.2 or similar?

 

I discovered this problem after installing STS 4.2, but I didn't try configuring anything before applying the patch, so I don't know if it triggered the problem or not. Note that the documentation for each() recommends using reset(), so it's probably a bug that needs to be reported upstream...

Link to comment
Share on other sites

If the original way of doing things was correct, then the correct way to fix this is to add this line before the while loop:

 

reset($HTTP_POST_VARS['configuration']);

 

 

for me , i can report that this " reset($HTTP_POST_VARS['configuration']); "

solves the problem, and now i can set the value -using simple t s to "true"-

 

thx for ya help & hint, great work dude :-"

Link to comment
Share on other sites

  • 2 weeks later...
Make sure that permissions on all your folders are set to 755, with permissions of 644 for all files - except for the two configure.php files, which can be either 644, 444 or 400 - depending on server setup.

 

Vger

 

it still doesn't work. i did like your instruction. i can't find the way out :'(

Link to comment
Share on other sites

  • 2 months later...
I have tried all this and I am still having the same problem.

#

Any ideas.

Thanks,

 

Note that if you have already applied the register globals patch then you need to insert :

 

reset($_POST['configuration']);

 

not

 

reset($HTTP_POST_VARS['configuration']);

 

And then, hey presto it all works.

Link to comment
Share on other sites

  • 3 weeks later...
  • 1 month later...
I noticed this was happening "out of the box" with the most recent OSC snapshot (Update 060817). Previous installations are fine. Many thanks Brett for the fix.

 

 

The fixes suggested aren't working for me. Is there some way I can get the previous modules.php and give that a try? Or will I simply break other things?

Link to comment
Share on other sites

The fixes suggested aren't working for me. Is there some way I can get the previous modules.php and give that a try? (I've already reloaded a clean copyof modules.php from 2.2-2) Or will I simply break other things?

 

 

There are a total of four changes suggested above and, one at a time, I have made all of them.

 

The file catalog/admin/includes/modules.php (I hope I've been editing the correct file!) has perms of 755.

 

I've been commenting out using // and //, or /* */

 

The most recent error message is:

Warning: reset() [function.reset]: Passed variable is not an array or object in /home/nmwoodwo/public_html/catalog/admin/modules.php on line 49

 

Warning: Variable passed to each() is not an array or object in /home/nmwoodwo/public_html/catalog/admin/modules.php on line 50

 

Warning: Cannot modify header information - headers already sent by (output started at /home/nmwoodwo/public_html/catalog/admin/modules.php:49) in /home/nmwoodwo/public_html/catalog/admin/includes/functions/general.php on line 18

 

and the relevant sections of the modules.php file look like this:

 

 

//foreach ($HTTP_POST_VARS['configuration'] as $key => $value){//

//reset($HTTP_POST_VARS['configuration']);//

reset($_POST['configuration']);

while (list($key, $value) = each($HTTP_POST_VARS['configuration'])) {

 

 

I've come a long way already ... too far to quit now. But I'm stopped 'cause I'm stumped.

Link to comment
Share on other sites

Hi, I'm having the same problem and none of the above solutions helped. I did install the updated version. Was the update a complete install or did I have to have the older version in first? Thanks, Bob

Link to comment
Share on other sites

Hi, I'm having the same problem and none of the above solutions helped. I did install the updated version. Was the update a complete install or did I have to have the older version in first? Thanks, Bob

Bob,

This is a known bug in the latest osCommerce 060817 release and has to do with the modules not refreshing with udated changes in the admin.

 

This fix has worked for several users:

1. Open the catalog/admin/includes/functions/compatibility.php.

2. At the end of the “do_magic_quotes_gpc” routine, add the following code

 

reset($ar);

 

It will end up looking like this:

 

function do_magic_quotes_gpc(&$ar) {
if (!is_array($ar)) return false;
while (list($key, $value) = each($ar)) {
if (is_array($ar[$key])) {
do_magic_quotes_gpc($ar[$key]);
} else {
$ar[$key] = addslashes($value);
}
}
reset($ar);
}

3. Do the same for the compatibility.php file located in catalog/includes/functions/compatibility.php.

Bill Kellum

 

Sounds Good Productions

STS Tutorials & more: STSv4.6, STS Add-ons (STS Power Pack), STS V4 Forum STS Forum FREE TEMPLATE

Link to comment
Share on other sites

hello

 

i try this and is not working

after i replace

 

(HTTP_POST_VARS['configuration'] as $key => $value)

 

i get this error

Parse error: syntax error, unexpected '[' in /is/htdocs/wpXXXXXXX_XXXXXXXX/www/admin/modules.php on line 46

 

i use log in over https://ssl.sssss.com/xxxxxx.com/admin/modu...xxxxxxxxxxxxxxx

 

any idea??

thank you

Link to comment
Share on other sites

  • 1 month later...

thank you brett.howard!!!

 

worked great for me after 6 hours of pulling out my hair :P

 

and thanks to Vger for pointing me here!

 

cheers,

snuggles

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...