Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Payment Module Problem


kezza01

Recommended Posts

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

 

Had the same problem on new installation and applied fix and now works a treat. Don't really understand why latest download version hasn't been fixed!
Link to comment
Share on other sites

  • 4 weeks later...
  • 2 weeks later...

I've not had any luck with the above fixes, but one interesting thing I've discovered is that it only gets hung up (returns the 'you don't have permission' message) when "http://" or "https://" is included in the Gateway URL field. Put anything else in there and it seems to work fine. Anybody have any idea what's up with that? And what are the consequences of leaving it out? Guess I'll find out soon.

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']);

 

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

 

thanks a lot my friend

Right now i can solve this problem already Yeah

God Bless You

Link to comment
Share on other sites

  • 2 weeks later...

:thumbsup:

This is where you need to put the "reset($HTTP_POST_VARS['configuration']);" patch without the quotes if you use this one.

 

reset($HTTP_POST_VARS['configuration']);

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

 

The other worked for me too.

 

Damned glad the patches were here. Otherwise I'd of pulled hair before I would of fingered it out.

Link to comment
Share on other sites

  • 1 month later...

Thank you, thank you, thank you. I have been searching for days for the solution to my shipping and payment module problem. The first fix mentioned in this thread fixed the problem, but the file was in admin/modules (no catalog file)

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

thanks!! this helped me a lot

Link to comment
Share on other sites

thanks!! this helped me a lot

The correct way to fix this problem is adding the reset. If you do it any other way, you are going to run into problems when you try to upgrade your osC shop to the current version.

 

See the following post for more info:

 

http://www.oscommerce.com/forums/index.php?sho...p;#entry1117449

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

  • 3 weeks later...

I upgraded my website from a shared server to a dedicated server going from Php 4 to php 5 and mysql 4 to mysql 5. I am not sure why we started to get this problem on the dedicated server but the one line solution below fix the problem.

 

Thanks for taking the time to post your solution. You save me some precious time like many other users I am sure.

 

Chris

 

:thumbsup: :thumbsup:

 

 

 

 

 

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 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! :)

hi

 

I found the solution to the above Problem

Just need to change a bolck of coed

 

In admin modules.php

Look for this

 

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

tep_db_query("update " . TABLE_CONFIGURATION . " set configuration_value = '" . $value . "' where configuration_key = '" . $key . "'");

}

 

and replce with this

 

foreach($HTTP_POST_VARS['configuration'] as $ind=>$val){

tep_db_query("update " . TABLE_CONFIGURATION . " set configuration_value = '" . $val . "' where configuration_key = '" . $ind . "'");

 

}

:)

Thats all

Link to comment
Share on other sites

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! :)

 

hi

 

I found the solution to the above Problem

Just need to change a bolck of coed

 

In admin modules.php

Look for this

 

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

tep_db_query("update " . TABLE_CONFIGURATION . " set configuration_value = '" . $value . "' where configuration_key = '" . $key . "'");

}

 

and replce with this

 

foreach($HTTP_POST_VARS['configuration'] as $ind=>$val){

tep_db_query("update " . TABLE_CONFIGURATION . " set configuration_value = '" . $val . "' where configuration_key = '" . $ind . "'");

 

}

:)

Thats all

:thumbsup: The "official fix" is given in post #33 above. It is the same fix that is also included in the latest osCommerce RC1 release.

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

I also bow down at the alter of "Brett". You saved a bunch of troubleshooting time.
I'm sorry but Brett's fix may cause you problems when you decide to upgrade your shop to the current version of osCommerce. Post 33 above is the correct way to fix this problem.

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

  • 1 month later...

I have tried all the above solutions but I am still having the same problem.

 

 

i have fixed all the permissions. Still i have problem, When i m implementing the above solutions then error message is comming and no update there....

 

Warning: reset(): Passed variable is not an array or object in /home/httpd/vhosts/internet-webshop.nl/subdomains/multishop/httpdocs/shop1/admin/modules.php on line 216

 

 

 

Any ideas.

Thanks,

Link to comment
Share on other sites

  • 6 months later...
  • 1 month later...
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

  • 11 months later...
  • 3 years later...

Hello,

 

I have, I think, a simulair problem.

 

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

 

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

 

switch ($action) {
   case 'edit':
  $keys = '';
  reset($mInfo->keys);
  while (list($key, $value) = each($mInfo->keys)) {
    $keys .= '<strong>' . $value['title'] . '</strong><br />' . $value['description'] . '<br />';
    if ($value['set_function']) {
	  eval('$keys .= ' . $value['set_function'] . "'" . $value['value'] . "', '" . $key . "');");
    } else {
	  $keys .= tep_draw_input_field('configuration[' . $key . ']', $value['value']);
    }
    $keys .= '<br /><br />';
  }
  $keys = substr($keys, 0, strrpos($keys, '<br /><br />'));
  $heading[] = array('text' => '<strong>' . $mInfo->title . '</strong>');
  $contents = array('form' => tep_draw_form('modules', FILENAME_MODULES, 'set=' . $set . '&module=' . $HTTP_GET_VARS['module'] . '&action=save'));
  $contents[] = array('text' => $keys);
  $contents[] = array('align' => 'center', 'text' => '<br />' . tep_draw_button(IMAGE_SAVE, 'disk', null, 'primary') . tep_draw_button(IMAGE_CANCEL, 'close', tep_href_link(FILENAME_MODULES, 'set=' . $set . '&module=' . $HTTP_GET_VARS['module'])));
  break;

 

Could someone help me out?

 

Thank you

Lili

Link to comment
Share on other sites

  • 2 weeks later...

Archived

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

×
×
  • Create New...