Jump to content



Photo
- - - - -

[Contribution] Upgrading osC from 2.2 MS2 to 2.2 RC2a


  • Please log in to reply
111 replies to this topic

#1 ONLINE   Jan Zonjee

Jan Zonjee

    Governor of Peace

  • Core Team
  • 7,094 posts
  • Real Name:Jan Zonjee
  • Gender:Male
  • Location:the Netherlands

Posted 05 April 2009 - 20:52

This is the support thread for the "Upgrading osC from 2.2 Milestone 2 to 2.2 RC2a" contribution (addon #6654).

This contribution documents and describes the changes to update a osCommerce 2.2 milestone 2 shop to the latest version (release candidate 2a).

This is useful for example in case your hosting upgraded MySQL to version 5, PHP to version 5, decided to set register globals to off or you want to implement the latest bugfixes and security fixes.

Edited by Jan Zonjee, 05 April 2009 - 21:04.


#2   pepe4567

pepe4567
  • Members
  • 10 posts
  • Real Name:Cesar

Posted 06 April 2009 - 09:43

This is the support thread for the "Upgrading osC from 2.2 Milestone 2 to 2.2 RC2a" contribution (addon #6654).

This contribution documents and describes the changes to update a osCommerce 2.2 milestone 2 shop to the latest version (release candidate 2a).

This is useful for example in case your hosting upgraded MySQL to version 5, PHP to version 5, decided to set register globals to off or you want to implement the latest bugfixes and security fixes.


Thank you for your big and good work.

I have a question: I have a 2.2 ms version installed but updated to RC1.

This contribution you made can't be used by me, isn't it?

Its posible to make a contribution to update from "2.2 upgrade RC1" to "RC2"?

Waiting your answer.

Kind regards!!!

#3 ONLINE   Jan Zonjee

Jan Zonjee

    Governor of Peace

  • Core Team
  • 7,094 posts
  • Real Name:Jan Zonjee
  • Gender:Male
  • Location:the Netherlands

Posted 06 April 2009 - 16:00

I have a question: I have a 2.2 ms version installed but updated to RC1.

This contribution you made can't be used by me, isn't it?

Its posible to make a contribution to update from "2.2 upgrade RC1" to "RC2"?

In the listing of files at the top of upgrade.html the last column on the right shows the issues and files which have been updated in RC2. If you use that list and check the changes for each file you will also see that with each code change for a file it mentions for which issue that is done. If it doesn't say so, it is the issue that was last mentioned.
So you could use this for upgrading from RC1 to RC2 also, but it takes a bit more effort.

Using the list of files that were updated in RC2 and a compare and merge program comparing/merging your files with those of RC2 should get you there too.

You would have to check the upgrade document for RC2 in the folder extras to see what sql changes were done solely in RC2.

#4   pepe4567

pepe4567
  • Members
  • 10 posts
  • Real Name:Cesar

Posted 08 April 2009 - 21:41

In the listing of files at the top of upgrade.html the last column on the right shows the issues and files which have been updated in RC2. If you use that list and check the changes for each file you will also see that with each code change for a file it mentions for which issue that is done. If it doesn't say so, it is the issue that was last mentioned.
So you could use this for upgrading from RC1 to RC2 also, but it takes a bit more effort.

Using the list of files that were updated in RC2 and a compare and merge program comparing/merging your files with those of RC2 should get you there too.

You would have to check the upgrade document for RC2 in the folder extras to see what sql changes were done solely in RC2.


Thank you Jan for your answer.

Do you think, this will make faster the sql work? I've change my php4 server to php5 and now the search work is so slow than php4 server.

RC2 changes can make this faster?

Thank you again for your big work.

Kind regards.

Cesar

#5 ONLINE   Jan Zonjee

Jan Zonjee

    Governor of Peace

  • Core Team
  • 7,094 posts
  • Real Name:Jan Zonjee
  • Gender:Male
  • Location:the Netherlands

Posted 08 April 2009 - 21:44

Do you think, this will make faster the sql work? I've change my php4 server to php5 and now the search work is so slow than php4 server.

RC2 changes can make this faster?

Some queries should be faster. Especially the ones that involve the table specials should perform better.

#6   Viper0409

Viper0409
  • Members
  • 49 posts
  • Real Name:Viper

Posted 12 April 2009 - 09:04

Hi

I am in the process of updating my osCommerce 2.2 MS2 to rc2a and I am manually editing each file because I have quite a few contributions in my store.

I have run into a problem as shown below.

Parse error: parse error in /catalog/includes/functions/compatibility.php on line 179

Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /catalog/includes/functions/compatibility.php:179) in /catalog/includes/functions/sessions.php on line 99


Can anyone offer any advice on how to overcome this.

Thanks in advance

Edited by Viper0409, 12 April 2009 - 09:06.


#7 ONLINE   Jan Zonjee

Jan Zonjee

    Governor of Peace

  • Core Team
  • 7,094 posts
  • Real Name:Jan Zonjee
  • Gender:Male
  • Location:the Netherlands

Posted 12 April 2009 - 09:06

Can anyone offer any advice on how to overcome this.

Fix the parse error on line 179 in the file /catalog/includes/functions/compatibility.php or better yet exchange that file with the one in the package. I can't think of a contribution that would want to change something in there but I might be wrong...

Edited by Jan Zonjee, 12 April 2009 - 09:07.


#8   Viper0409

Viper0409
  • Members
  • 49 posts
  • Real Name:Viper

Posted 12 April 2009 - 09:11

Hi Jan

Wow, thanks for the lightning fast reply.

The only thing that is on line 179 in compatibility.php is " ?> ", which is right isn't it? /huh.gif' class='bbc_emoticon' alt=':huh:' />

#9   Viper0409

Viper0409
  • Members
  • 49 posts
  • Real Name:Viper

Posted 12 April 2009 - 09:27

ok I just compared the two files, one from the package and my local file, and this is the only difference.

if (!is_array($ar)) return false;


and

if (is_array($ar[$key])) {
do_magic_quotes_gpc($ar[$key]);


The first quote is the package file and the second is my file. Should I make it same as the package file or would there be a reason for the difference?

Thanks

Edited by Viper0409, 12 April 2009 - 09:28.


#10   Viper0409

Viper0409
  • Members
  • 49 posts
  • Real Name:Viper

Posted 12 April 2009 - 09:51

Ok I went ahead and made the above change to the compatibility.php file and it has cleared the problem. It remains to be seen if something else is broken, but I will keep my fingers crossed.

BTW, thanks for this awesome contribution. It makes life so much easier to be able to follow step by step each step of the upgrade.

#11 ONLINE   Jan Zonjee

Jan Zonjee

    Governor of Peace

  • Core Team
  • 7,094 posts
  • Real Name:Jan Zonjee
  • Gender:Male
  • Location:the Netherlands

Posted 12 April 2009 - 09:54

The first quote is the package file and the second is my file. Should I make it same as the package file or would there be a reason for the difference?

Looks like you misinterpreted the instructions slightly. The line you added the do_magic_quotes_gpc after is on it's own. For comparison this is the old function:
function do_magic_quotes_gpc(&$ar) {
	if (!is_array($ar)) return false;

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

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


#12   Viper0409

Viper0409
  • Members
  • 49 posts
  • Real Name:Viper

Posted 12 April 2009 - 10:00

Thanks Jan

Yes, after doing a file comparison I saw the problem and swapped out the mistake.

Thanks for taking the time to look at this. /smile.gif' class='bbc_emoticon' alt=':)' />

#13   jester420247sl

jester420247sl
  • Members
  • 45 posts
  • Real Name:Shawn

Posted 15 May 2009 - 02:49

Does this only work with unmodded sites? I have a custom template with contributions installed. Will that fact make it difficult to impossable to make the changes myself manually?

#14 ONLINE   Jan Zonjee

Jan Zonjee

    Governor of Peace

  • Core Team
  • 7,094 posts
  • Real Name:Jan Zonjee
  • Gender:Male
  • Location:the Netherlands

Posted 16 May 2009 - 06:37

Does this only work with unmodded sites? I have a custom template with contributions installed. Will that fact make it difficult to impossable to make the changes myself manually?

A lot of the code changes are in files a template wouldn't need to touch. But undoubtedly there will be files that have been changed by contributions that will need some consideration before adding the changes needed for the upgrading.
No general answer can be given of course.

#15   kbking

kbking
  • Members
  • 266 posts
  • Real Name:Chris

Posted 16 May 2009 - 16:56

A lot of the code changes are in files a template wouldn't need to touch. But undoubtedly there will be files that have been changed by contributions that will need some consideration before adding the changes needed for the upgrading.
No general answer can be given of course.


Before I upgrade from rc1 to rc2, I'd like to know if any functionality will be removed by upgrading? I don't really want to loose anything that I have now with my rc1 setup! I don't mean functionality that I personally have added, I rather mean from stock rc1 to stock rc2, so to speak.

As I interpret the upgrade document, each upgrade change is independent of the other. If so, I should be OK by leaving out a few changes!? I'm asking this because I have quite a few contributions installed that might cause difficulties in doing some changes (since I'm not an experienced coder).

Also, I'm curious about why $HTTP_POST_VARS and $HTTP_GET_VARS has been used in upgrade changes as opposed to the global $_POST and $_GET?

#16 ONLINE   Jan Zonjee

Jan Zonjee

    Governor of Peace

  • Core Team
  • 7,094 posts
  • Real Name:Jan Zonjee
  • Gender:Male
  • Location:the Netherlands

Posted 16 May 2009 - 22:37

Before I upgrade from rc1 to rc2, I'd like to know if any functionality will be removed by upgrading? I don't really want to loose anything that I have now with my rc1 setup! I don't mean functionality that I personally have added, I rather mean from stock rc1 to stock rc2, so to speak.

I don't remember functionality being removed but with contributions you have to be aware of the changing of tep_add_tax to using a new function in the class currencies.

As I interpret the upgrade document, each upgrade change is independent of the other. If so, I should be OK by leaving out a few changes!? I'm asking this because I have quite a few contributions installed that might cause difficulties in doing some changes (since I'm not an experienced coder).

I wouldn't know. I would try to add everything personally.

Also, I'm curious about why $HTTP_POST_VARS and $HTTP_GET_VARS has been used in upgrade changes as opposed to the global $_POST and $_GET?

If you really wanted to change all of them you would have to change almost every file in osC. For the new code I would have preferred to use the $_POST and $_GET but I think the official party line is that it would not be PHP3 compatible. In one of the updates Harald even rolled back using $_POST and $_GET to $HTTP_POST_VARS and $HTTP_GET_VARS because of that. I think it was somewhere in the admin for whos_online or something like that (left that out BTW).

Never seen someone mentioning an error using that so that should tell you something about how many stores were still using PHP3 when MS2.2 started...

#17   solosc

solosc
  • Members
  • 10 posts
  • Real Name:Sebastiaan

Posted 19 June 2009 - 13:27

Hi,

I have managed to follow your instructions and completed all the steps. Thank you very much for putting this together!

Everything works, except for one thing.
On the checkout_confirmation page the amount for a fixed payment charge (module: http://www.oscommerc...ributions,4125) is doubled.
This is an Order Total module contrib.

If I choose any shipping or payment combination it does work as expected. However, as soon as I choose the payment option which triggers this order total module it duplicates the amount.

Example:
shopping cart (free payment method chosen)
item 1: 50.00
item 2: 50.00
subtotal: 100.00
shipping: 5.00
total: 105.00

Now I choose a payment method that adds a fee of 7.50 (setup in admin as order total):
shopping cart
item 1: 50.00
item 2: 50.00
subtotal: 100.00
shipping: 5.00
payment fee: 7.50
total: 120.00

You see, although the payment fee shows as 7.50 (as maintained in admin, order total module) the total is increased by twice this fee (7.50x2=15.00).

This only happens in my new upgraded store after I completed all the steps.
I'm just wondering if you or any one has any idea?
Is it something that is changed in checkout_confirmation.php, order.php or shoppingcart.php ?
Or do I need to change coding of this order total module contrib (not desired) and besides it only occurs now after I upgraded.

I do hope someone can just tell me where the cause for this issue occurs, so that I can reverse that part (if possible) or check whether I indeed followed exactly the instructions.

Thanks!

#18 ONLINE   Jan Zonjee

Jan Zonjee

    Governor of Peace

  • Core Team
  • 7,094 posts
  • Real Name:Jan Zonjee
  • Gender:Male
  • Location:the Netherlands

Posted 19 June 2009 - 21:36

This only happens in my new upgraded store after I completed all the steps.
I'm just wondering if you or any one has any idea?

In the support thread it is mentioned it is not working with rc2. To check if it was something simple I even installed it and I can tell you I cannot even get it working. For some reason I can see the fee announced in checkout_payment.php but then it disappears again and it never gets added to the total in the next page.

Must be something with the global and using the wrong ones in the contribution or something like that. No clue how to fix this.

#19   solosc

solosc
  • Members
  • 10 posts
  • Real Name:Sebastiaan

Posted 20 June 2009 - 13:41

In the support thread it is mentioned it is not working with rc2. To check if it was something simple I even installed it and I can tell you I cannot even get it working. For some reason I can see the fee announced in checkout_payment.php but then it disappears again and it never gets added to the total in the next page.

Must be something with the global and using the wrong ones in the contribution or something like that. No clue how to fix this.


thanks anyway. I noticed the comments in that support thread and it's suggested to use an alternative contrib. I'll try this.
At least the issue can be marked as related to the contrib and not to the upgrade I've done.

#20   solosc

solosc
  • Members
  • 10 posts
  • Real Name:Sebastiaan

Posted 20 June 2009 - 15:28

I tried several other contribs.
Some of them didn't allow to enter a fixed amount/fee only (just a percentage).

The only other contrib that seems to allow this is: http://addons.oscommerce.com/info/801
However, after having it installed I have exactly the same problem.

Seems to be R2a issue. Just suprised that this hasn't been fixed in meantime.
It's quite annoying because I can't continue the upgrade if I can't use an order total module that allows to add a fixed fee.

I'll try to reverse the R2a upgrade steps of the checkout_confirmation page only and leave others as they are.
Alternatively someone could check the code. Unfortunately I'm not a programmer. Any help is appreciated of course!

Should this issue be logged as a bug of R2a?